]> Cypherpunks repositories - gostls13.git/commitdiff
os: clarify that Close cancels pending I/O
authorIan Lance Taylor <iant@golang.org>
Tue, 10 Jul 2018 13:47:44 +0000 (06:47 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 11 Jul 2018 00:06:19 +0000 (00:06 +0000)
Change-Id: I6be6818d951a999f916c2266a6753a5ce5144ee7
Reviewed-on: https://go-review.googlesource.com/122955
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/os/file_plan9.go
src/os/file_unix.go
src/os/file_windows.go

index feca8630beaf907d5b7d8d1bf3087330e3a35d32..3a0b774aa2d7dd403280199e5f768e6a818de625 100644 (file)
@@ -133,7 +133,8 @@ func openFileNolog(name string, flag int, perm FileMode) (*File, error) {
 }
 
 // Close closes the File, rendering it unusable for I/O.
-// It returns an error, if any.
+// On files that support SetDeadline, any pending I/O operations will
+// be canceled and return immediately with an error.
 func (f *File) Close() error {
        if err := f.checkValid("close"); err != nil {
                return err
index e0b8119d968c2e3896db21efdfbc964f94b64749..4f80553a18f683f4d52bb517203a2ed8cf6db753 100644 (file)
@@ -217,7 +217,8 @@ func openFileNolog(name string, flag int, perm FileMode) (*File, error) {
 }
 
 // Close closes the File, rendering it unusable for I/O.
-// It returns an error, if any.
+// On files that support SetDeadline, any pending I/O operations will
+// be canceled and return immediately with an error.
 func (f *File) Close() error {
        if f == nil {
                return ErrInvalid
index a17c6e2ac337497e572f5b172aba6859066ba945..8901eadd25667b84beeab2b137595bea37b10ef7 100644 (file)
@@ -171,7 +171,8 @@ func openFileNolog(name string, flag int, perm FileMode) (*File, error) {
 }
 
 // Close closes the File, rendering it unusable for I/O.
-// It returns an error, if any.
+// On files that support SetDeadline, any pending I/O operations will
+// be canceled and return immediately with an error.
 func (file *File) Close() error {
        if file == nil {
                return ErrInvalid