aboutsummaryrefslogtreecommitdiff
path: root/src/go/parser/interface.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/parser/interface.go')
-rw-r--r--src/go/parser/interface.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/go/parser/interface.go b/src/go/parser/interface.go
index 54f9d7b80a..cc7e455c4d 100644
--- a/src/go/parser/interface.go
+++ b/src/go/parser/interface.go
@@ -12,8 +12,8 @@ import (
"go/ast"
"go/token"
"io"
+ "io/fs"
"io/ioutil"
- "os"
"path/filepath"
"strings"
)
@@ -35,7 +35,7 @@ func readSource(filename string, src interface{}) ([]byte, error) {
return s.Bytes(), nil
}
case io.Reader:
- return ioutil.ReadAll(s)
+ return io.ReadAll(s)
}
return nil, errors.New("invalid source")
}
@@ -123,7 +123,7 @@ func ParseFile(fset *token.FileSet, filename string, src interface{}, mode Mode)
// directory specified by path and returns a map of package name -> package
// AST with all the packages found.
//
-// If filter != nil, only the files with os.FileInfo entries passing through
+// If filter != nil, only the files with fs.FileInfo entries passing through
// the filter (and ending in ".go") are considered. The mode bits are passed
// to ParseFile unchanged. Position information is recorded in fset, which
// must not be nil.
@@ -132,7 +132,7 @@ func ParseFile(fset *token.FileSet, filename string, src interface{}, mode Mode)
// returned. If a parse error occurred, a non-nil but incomplete map and the
// first error encountered are returned.
//
-func ParseDir(fset *token.FileSet, path string, filter func(os.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error) {
+func ParseDir(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error) {
list, err := ioutil.ReadDir(path)
if err != nil {
return nil, err