aboutsummaryrefslogtreecommitdiff
path: root/src/internal
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/internal
parentd4da735091986868015369e01c63794af9cc9b84 (diff)
downloadgo-7bb721b9384bdd196befeaed593b185f7f2a5589.tar.gz
go-7bb721b9384bdd196befeaed593b185f7f2a5589.zip
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/internal')
-rw-r--r--src/internal/poll/error_test.go3
-rw-r--r--src/internal/reflectlite/reflect_mirror_test.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/internal/poll/error_test.go b/src/internal/poll/error_test.go
index 06b96f635a..abc8b1684f 100644
--- a/src/internal/poll/error_test.go
+++ b/src/internal/poll/error_test.go
@@ -6,6 +6,7 @@ package poll_test
import (
"fmt"
+ "io/fs"
"net"
"os"
"testing"
@@ -37,7 +38,7 @@ func parseReadError(nestedErr error, verify func(error) (string, bool)) error {
if nerr, ok := err.(*net.OpError); ok {
err = nerr.Err
}
- if nerr, ok := err.(*os.PathError); ok {
+ if nerr, ok := err.(*fs.PathError); ok {
err = nerr.Err
}
if nerr, ok := err.(*os.SyscallError); ok {
diff --git a/src/internal/reflectlite/reflect_mirror_test.go b/src/internal/reflectlite/reflect_mirror_test.go
index fbb6fb397e..9b28b13550 100644
--- a/src/internal/reflectlite/reflect_mirror_test.go
+++ b/src/internal/reflectlite/reflect_mirror_test.go
@@ -9,6 +9,7 @@ import (
"go/ast"
"go/parser"
"go/token"
+ "io/fs"
"os"
"path/filepath"
"runtime"
@@ -71,7 +72,7 @@ func (v visitor) Visit(n ast.Node) ast.Visitor {
func loadTypes(path, pkgName string, v visitor) {
fset := token.NewFileSet()
- filter := func(fi os.FileInfo) bool {
+ filter := func(fi fs.FileInfo) bool {
return strings.HasSuffix(fi.Name(), ".go")
}
pkgs, err := parser.ParseDir(fset, path, filter, 0)