File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ package vfs
77import (
88 "fmt"
99 "go/build"
10- "io/ioutil"
1110 "os"
1211 pathpkg "path"
1312 "path/filepath"
1413 "runtime"
1514 "slices"
15+
16+ "golang.org/x/tools/go/buildutil"
1617)
1718
1819// We expose a new variable because otherwise we need to copy the findGOROOT logic again
@@ -100,5 +101,5 @@ func (root osFS) Stat(path string) (os.FileInfo, error) {
100101}
101102
102103func (root osFS ) ReadDir (path string ) ([]os.FileInfo , error ) {
103- return ioutil . ReadDir (root .resolve (path )) // is sorted
104+ return buildutil . GetFileInfos (root .resolve (path )) // is sorted
104105}
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import (
1515 "go/token"
1616 "go/types"
1717 "io/fs"
18- "io/ioutil"
1918 "os"
2019 "path"
2120 "path/filepath"
@@ -30,6 +29,7 @@ import (
3029 "maps"
3130
3231 "golang.org/x/tools/go/ast/astutil"
32+ "golang.org/x/tools/go/buildutil"
3333 "golang.org/x/tools/internal/event"
3434 "golang.org/x/tools/internal/gocommand"
3535 "golang.org/x/tools/internal/gopathwalk"
@@ -1081,7 +1081,7 @@ func (e *ProcessEnv) buildContext() (*build.Context, error) {
10811081 // HACK: setting any of the Context I/O hooks prevents Import from invoking
10821082 // 'go list', regardless of GO111MODULE. This is undocumented, but it's
10831083 // unlikely to change before GOPATH support is removed.
1084- ctx .ReadDir = ioutil . ReadDir
1084+ ctx .ReadDir = buildutil . GetFileInfos
10851085
10861086 return & ctx , nil
10871087}
You can’t perform that action at this time.
0 commit comments