mirror of
https://github.com/golang/go.git
synced 2026-04-02 17:30:01 +09:00
io/fs: document when ErrClosed should be returned
Pull ErrClosed out of the grouped var declaration so it can have its own doc comment explaining that file system implementations should return it when operations are attempted on a closed file. Fixes #63918 Change-Id: I1fe2041c594ad6fd37e240e21fe9b3d4104daa46 Reviewed-on: https://go-review.googlesource.com/c/go/+/741446 Reviewed-by: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
This commit is contained in:
@@ -155,9 +155,12 @@ var (
|
||||
ErrPermission = errPermission() // "permission denied"
|
||||
ErrExist = errExist() // "file already exists"
|
||||
ErrNotExist = errNotExist() // "file does not exist"
|
||||
ErrClosed = errClosed() // "file already closed"
|
||||
)
|
||||
|
||||
// ErrClosed is returned when operations are attempted on a file that
|
||||
// has already been closed, including when Close is called more than once.
|
||||
var ErrClosed = errClosed()
|
||||
|
||||
func errInvalid() error { return oserror.ErrInvalid }
|
||||
func errPermission() error { return oserror.ErrPermission }
|
||||
func errExist() error { return oserror.ErrExist }
|
||||
|
||||
Reference in New Issue
Block a user