From 7bb721b9384bdd196befeaed593b185f7f2a5589 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 7 Jul 2020 13:49:21 -0400 Subject: 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 Run-TryBot: Russ Cox TryBot-Result: Go Bot Reviewed-by: Rob Pike --- src/go/doc/doc_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/go/doc/doc_test.go') diff --git a/src/go/doc/doc_test.go b/src/go/doc/doc_test.go index f1e612c18b..ab98bed62b 100644 --- a/src/go/doc/doc_test.go +++ b/src/go/doc/doc_test.go @@ -12,8 +12,8 @@ import ( "go/parser" "go/printer" "go/token" + "io/fs" "io/ioutil" - "os" "path/filepath" "regexp" "strings" @@ -66,7 +66,7 @@ func indentFmt(indent, s string) string { return indent + strings.ReplaceAll(s, "\n", "\n"+indent) + end } -func isGoFile(fi os.FileInfo) bool { +func isGoFile(fi fs.FileInfo) bool { name := fi.Name() return !fi.IsDir() && len(name) > 0 && name[0] != '.' && // ignore .files @@ -86,7 +86,7 @@ func test(t *testing.T, mode Mode) { if err != nil { t.Fatal(err) } - filter = func(fi os.FileInfo) bool { + filter = func(fi fs.FileInfo) bool { return isGoFile(fi) && rx.MatchString(fi.Name()) } } -- cgit v1.2.1