File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ func NewDepguard() *goanalysis.Linter {
51
51
}
52
52
}).WithIssuesReporter (func (* linter.Context ) []goanalysis.Issue {
53
53
return resIssues
54
- }).WithLoadMode (goanalysis .LoadModeTypesInfo )
54
+ }).WithLoadMode (goanalysis .LoadModeSyntax )
55
55
}
56
56
57
57
type depGuard struct {
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ import (
8
8
)
9
9
10
10
func MakeFakeLoaderProgram (pass * analysis.Pass ) * loader.Program {
11
+ var info types.Info
12
+ if pass .TypesInfo != nil {
13
+ info = * pass .TypesInfo
14
+ }
15
+
11
16
prog := & loader.Program {
12
17
Fset : pass .Fset ,
13
18
Created : []* loader.PackageInfo {
@@ -18,7 +23,7 @@ func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program {
18
23
19
24
Files : pass .Files ,
20
25
Errors : nil ,
21
- Info : * pass . TypesInfo ,
26
+ Info : info ,
22
27
},
23
28
},
24
29
AllPackages : map [* types.Package ]* loader.PackageInfo {
@@ -28,7 +33,7 @@ func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program {
28
33
TransitivelyErrorFree : true ,
29
34
Files : pass .Files ,
30
35
Errors : nil ,
31
- Info : * pass . TypesInfo ,
36
+ Info : info ,
32
37
},
33
38
},
34
39
}
Original file line number Diff line number Diff line change @@ -219,7 +219,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
219
219
220
220
linter .NewConfig (golinters .NewDepguard ()).
221
221
WithSince ("v1.4.0" ).
222
- WithLoadForGoAnalysis ().
223
222
WithPresets (linter .PresetStyle , linter .PresetImport , linter .PresetModule ).
224
223
WithURL ("https://github.com/OpenPeeDeeP/depguard" ),
225
224
You can’t perform that action at this time.
0 commit comments