summaryrefslogtreecommitdiff
path: root/src/errors/errors.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-07-07 13:49:21 -0400
committerRuss Cox <rsc@golang.org>2020-10-20 02:32:42 +0000
commit7bb721b9384bdd196befeaed593b185f7f2a5589 (patch)
tree882f21fc2e1fbba6fb11100e4fd8efc5f973a44d /src/errors/errors.go
parentd4da735091986868015369e01c63794af9cc9b84 (diff)
downloadgo-git-7bb721b9384bdd196befeaed593b185f7f2a5589.tar.gz
all: update references to symbols moved from os to io/fs
The old os references are still valid, but update our code to reflect best practices and get used to the new locations. Code compiled with the bootstrap toolchain (cmd/asm, cmd/dist, cmd/compile, debug/elf) must remain Go 1.4-compatible and is excluded. For #41190. Change-Id: I8f9526977867c10a221e2f392f78d7dec073f1bd Reviewed-on: https://go-review.googlesource.com/c/go/+/243907 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/errors/errors.go')
-rw-r--r--src/errors/errors.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/errors/errors.go b/src/errors/errors.go
index d923ad4b70..f2fabacd4e 100644
--- a/src/errors/errors.go
+++ b/src/errors/errors.go
@@ -27,30 +27,30 @@
// second. It reports whether it finds a match. It should be used in preference to
// simple equality checks:
//
-// if errors.Is(err, os.ErrExist)
+// if errors.Is(err, fs.ErrExist)
//
// is preferable to
//
-// if err == os.ErrExist
+// if err == fs.ErrExist
//
-// because the former will succeed if err wraps os.ErrExist.
+// because the former will succeed if err wraps fs.ErrExist.
//
// As unwraps its first argument sequentially looking for an error that can be
// assigned to its second argument, which must be a pointer. If it succeeds, it
// performs the assignment and returns true. Otherwise, it returns false. The form
//
-// var perr *os.PathError
+// var perr *fs.PathError
// if errors.As(err, &perr) {
// fmt.Println(perr.Path)
// }
//
// is preferable to
//
-// if perr, ok := err.(*os.PathError); ok {
+// if perr, ok := err.(*fs.PathError); ok {
// fmt.Println(perr.Path)
// }
//
-// because the former will succeed if err wraps an *os.PathError.
+// because the former will succeed if err wraps an *fs.PathError.
package errors
// New returns an error that formats as the given text.