doc: clarify safety of multiple and concurent os.(*File).Close() calls

Fixes #32427

Change-Id: I4b863bd3836067dcc2eb3a9c3a7169656763d003
Reviewed-on: https://go-review.googlesource.com/c/go/+/180438
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Alex Myasoedov 2019-06-04 20:07:57 +02:00 committed by Rob Pike
parent 49200e3f3e
commit fc705275c3
3 changed files with 3 additions and 0 deletions

View file

@ -225,6 +225,7 @@ func openFileNolog(name string, flag int, perm FileMode) (*File, error) {
// Close closes the File, rendering it unusable for I/O.
// On files that support SetDeadline, any pending I/O operations will
// be canceled and return immediately with an error.
// Close will return an error if it has already been called.
func (f *File) Close() error {
if f == nil {
return ErrInvalid