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
7
7
import (
8
8
"fmt"
9
9
"go/build"
10
- "io/ioutil"
11
10
"os"
12
11
pathpkg "path"
13
12
"path/filepath"
14
13
"runtime"
15
14
"slices"
15
+
16
+ "golang.org/x/tools/go/buildutil"
16
17
)
17
18
18
19
// 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) {
100
101
}
101
102
102
103
func (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
104
105
}
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import (
15
15
"go/token"
16
16
"go/types"
17
17
"io/fs"
18
- "io/ioutil"
19
18
"os"
20
19
"path"
21
20
"path/filepath"
@@ -30,6 +29,7 @@ import (
30
29
"maps"
31
30
32
31
"golang.org/x/tools/go/ast/astutil"
32
+ "golang.org/x/tools/go/buildutil"
33
33
"golang.org/x/tools/internal/event"
34
34
"golang.org/x/tools/internal/gocommand"
35
35
"golang.org/x/tools/internal/gopathwalk"
@@ -1081,7 +1081,7 @@ func (e *ProcessEnv) buildContext() (*build.Context, error) {
1081
1081
// HACK: setting any of the Context I/O hooks prevents Import from invoking
1082
1082
// 'go list', regardless of GO111MODULE. This is undocumented, but it's
1083
1083
// unlikely to change before GOPATH support is removed.
1084
- ctx .ReadDir = ioutil . ReadDir
1084
+ ctx .ReadDir = buildutil . GetFileInfos
1085
1085
1086
1086
return & ctx , nil
1087
1087
}
You can’t perform that action at this time.
0 commit comments