diff options
| author | Russ Cox <rsc@golang.org> | 2020-07-07 13:49:21 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2020-10-20 02:32:42 +0000 |
| commit | 7bb721b9384bdd196befeaed593b185f7f2a5589 (patch) | |
| tree | 882f21fc2e1fbba6fb11100e4fd8efc5f973a44d /src/net/http/fs.go | |
| parent | d4da735091986868015369e01c63794af9cc9b84 (diff) | |
| download | go-7bb721b9384bdd196befeaed593b185f7f2a5589.tar.xz | |
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/net/http/fs.go')
| -rw-r--r-- | src/net/http/fs.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/net/http/fs.go b/src/net/http/fs.go index d718fffba0..0743b5b621 100644 --- a/src/net/http/fs.go +++ b/src/net/http/fs.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "io/fs" "mime" "mime/multipart" "net/textproto" @@ -43,7 +44,7 @@ type Dir string // mapDirOpenError maps the provided non-nil error from opening name // to a possibly better non-nil error. In particular, it turns OS-specific errors -// about opening files in non-directories into os.ErrNotExist. See Issue 18984. +// about opening files in non-directories into fs.ErrNotExist. See Issue 18984. func mapDirOpenError(originalErr error, name string) error { if os.IsNotExist(originalErr) || os.IsPermission(originalErr) { return originalErr @@ -59,7 +60,7 @@ func mapDirOpenError(originalErr error, name string) error { return originalErr } if !fi.IsDir() { - return os.ErrNotExist + return fs.ErrNotExist } } return originalErr @@ -98,8 +99,8 @@ type File interface { io.Closer io.Reader io.Seeker - Readdir(count int) ([]os.FileInfo, error) - Stat() (os.FileInfo, error) + Readdir(count int) ([]fs.FileInfo, error) + Stat() (fs.FileInfo, error) } func dirList(w ResponseWriter, r *Request, f File) { |
