3 ms·
The implementation of `os.File.Close()` in Go clears the file descriptor. https://pkg.go.dev/os#File.Close https://pkg.go.dev/os#File.Close “Close will return
by klodolph 2y ago
The implementation of `os.File.Close()` in Go clears the file descriptor.
https://pkg.go.dev/os#File.Close https://pkg.go.dev/os#File.Close
“Close will return an error if it has already been called.”
An os.File is a data structure containing a file descriptor and some other fields. It is safe to call Close() multiple times, because it will only call the underlying syscall close() once.