File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 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 {
5151 }
5252 }).WithIssuesReporter (func (* linter.Context ) []goanalysis.Issue {
5353 return resIssues
54- }).WithLoadMode (goanalysis .LoadModeTypesInfo )
54+ }).WithLoadMode (goanalysis .LoadModeSyntax )
5555}
5656
5757type depGuard struct {
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ import (
88)
99
1010func MakeFakeLoaderProgram (pass * analysis.Pass ) * loader.Program {
11+ var info types.Info
12+ if pass .TypesInfo != nil {
13+ info = * pass .TypesInfo
14+ }
15+
1116 prog := & loader.Program {
1217 Fset : pass .Fset ,
1318 Created : []* loader.PackageInfo {
@@ -18,7 +23,7 @@ func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program {
1823
1924 Files : pass .Files ,
2025 Errors : nil ,
21- Info : * pass . TypesInfo ,
26+ Info : info ,
2227 },
2328 },
2429 AllPackages : map [* types.Package ]* loader.PackageInfo {
@@ -28,7 +33,7 @@ func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program {
2833 TransitivelyErrorFree : true ,
2934 Files : pass .Files ,
3035 Errors : nil ,
31- Info : * pass . TypesInfo ,
36+ Info : info ,
3237 },
3338 },
3439 }
Original file line number Diff line number Diff line change @@ -219,7 +219,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
219219
220220 linter .NewConfig (golinters .NewDepguard ()).
221221 WithSince ("v1.4.0" ).
222- WithLoadForGoAnalysis ().
223222 WithPresets (linter .PresetStyle , linter .PresetImport , linter .PresetModule ).
224223 WithURL ("https://github.com/OpenPeeDeeP/depguard" ),
225224
You can’t perform that action at this time.
0 commit comments