From 7bb721b9384bdd196befeaed593b185f7f2a5589 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 7 Jul 2020 13:49:21 -0400 Subject: 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 Run-TryBot: Russ Cox TryBot-Result: Go Bot Reviewed-by: Rob Pike --- src/errors/errors.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/errors/errors.go') 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. -- cgit v1.2.1