diff options
Diffstat (limited to 'src/cmd/compile/internal/syntax/parser_test.go')
-rw-r--r-- | src/cmd/compile/internal/syntax/parser_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/compile/internal/syntax/parser_test.go b/src/cmd/compile/internal/syntax/parser_test.go index b3d4573935..74583ca903 100644 --- a/src/cmd/compile/internal/syntax/parser_test.go +++ b/src/cmd/compile/internal/syntax/parser_test.go @@ -9,7 +9,7 @@ import ( "flag" "fmt" "internal/testenv" - "io/ioutil" + "os" "path/filepath" "regexp" "runtime" @@ -112,21 +112,21 @@ func TestStdLib(t *testing.T) { } func walkDirs(t *testing.T, dir string, action func(string)) { - fis, err := ioutil.ReadDir(dir) + entries, err := os.ReadDir(dir) if err != nil { t.Error(err) return } var files, dirs []string - for _, fi := range fis { - if fi.Mode().IsRegular() { - if strings.HasSuffix(fi.Name(), ".go") { - path := filepath.Join(dir, fi.Name()) + for _, entry := range entries { + if entry.Type().IsRegular() { + if strings.HasSuffix(entry.Name(), ".go") { + path := filepath.Join(dir, entry.Name()) files = append(files, path) } - } else if fi.IsDir() && fi.Name() != "testdata" { - path := filepath.Join(dir, fi.Name()) + } else if entry.IsDir() && entry.Name() != "testdata" { + path := filepath.Join(dir, entry.Name()) if !strings.HasSuffix(path, string(filepath.Separator)+"test") { dirs = append(dirs, path) } |