aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/syntax/parser_test.go
diff options
context:
space:
mode:
authorAndy Pan <panjf2000@gmail.com>2022-08-28 03:38:00 +0800
committerGopher Robot <gobot@golang.org>2022-09-20 02:13:02 +0000
commitf8c659b62ff43e8455ebc675e577b9adc67b3f9f (patch)
tree967f364a5943aa7323224d56a2eb5c969a81ddbe /src/cmd/compile/internal/syntax/parser_test.go
parent1e7e160d070443147ee38d4de530ce904637a4f3 (diff)
downloadgo-f8c659b62ff43e8455ebc675e577b9adc67b3f9f.tar.xz
all: replace package ioutil with os and io in src
For #45557 Change-Id: I56824135d86452603dd4ed4bab0e24c201bb0683 Reviewed-on: https://go-review.googlesource.com/c/go/+/426257 Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Andy Pan <panjf2000@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/parser_test.go')
-rw-r--r--src/cmd/compile/internal/syntax/parser_test.go16
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)
}