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/os/os_windows_test.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/os/os_windows_test.go')
| -rw-r--r-- | src/os/os_windows_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/os/os_windows_test.go b/src/os/os_windows_test.go index f03ec750d0..e002774844 100644 --- a/src/os/os_windows_test.go +++ b/src/os/os_windows_test.go @@ -12,6 +12,7 @@ import ( "internal/syscall/windows/registry" "internal/testenv" "io" + "io/fs" "io/ioutil" "os" osexec "os/exec" @@ -164,11 +165,11 @@ func testDirLinks(t *testing.T, tests []dirLinkTest) { t.Errorf("failed to lstat link %v: %v", link, err) continue } - if m := fi2.Mode(); m&os.ModeSymlink == 0 { + if m := fi2.Mode(); m&fs.ModeSymlink == 0 { t.Errorf("%q should be a link, but is not (mode=0x%x)", link, uint32(m)) continue } - if m := fi2.Mode(); m&os.ModeDir != 0 { + if m := fi2.Mode(); m&fs.ModeDir != 0 { t.Errorf("%q should be a link, not a directory (mode=0x%x)", link, uint32(m)) continue } @@ -681,7 +682,7 @@ func TestStatSymlinkLoop(t *testing.T) { defer os.Remove("x") _, err = os.Stat("x") - if _, ok := err.(*os.PathError); !ok { + if _, ok := err.(*fs.PathError); !ok { t.Errorf("expected *PathError, got %T: %v\n", err, err) } } @@ -1291,9 +1292,9 @@ func TestWindowsReadlink(t *testing.T) { // os.Mkdir(os.DevNull) fails. func TestMkdirDevNull(t *testing.T) { err := os.Mkdir(os.DevNull, 777) - oserr, ok := err.(*os.PathError) + oserr, ok := err.(*fs.PathError) if !ok { - t.Fatalf("error (%T) is not *os.PathError", err) + t.Fatalf("error (%T) is not *fs.PathError", err) } errno, ok := oserr.Err.(syscall.Errno) if !ok { |
