We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The current documentation for os.(*File).Close() doesn't specify whether it's safe to call Close multiple times.
os.(*File).Close()
Close
This is useful for code like this:
func doSomething() error { f, err := os.Create("foo") if err != nil { return err } defer f.Close() if _, err := f.Write([]byte("bar"); err != nil { return err } return f.Close() }
go version go1.12 linux/amd64 GOARCH="amd64" GOBIN="/home/icholy/go/bin" GOCACHE="/home/icholy/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/icholy/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" GOROOT/bin/go version: go version go1.12 linux/amd64 GOROOT/bin/go tool compile -V: compile version go1.12 uname -sr: Linux 4.4.0-148-generic LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial /lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.23-0ubuntu11) stable release version 2.23, by Roland McGrath et al. gdb --version: GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/180438 mentions this issue: doc: clarify safety of mupltiple and concurent os.(*File).Close() calls
doc: clarify safety of mupltiple and concurent os.(*File).Close() calls
Sorry, something went wrong.
fc70527
No branches or pull requests
The current documentation for
os.(*File).Close()
doesn't specify whether it's safe to callClose
multiple times.This is useful for code like this:
System details
The text was updated successfully, but these errors were encountered: