File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ func New(settings *config.GodoxSettings) *goanalysis.Linter {
18
18
Name : linterName ,
19
19
Doc : goanalysis .TheOnlyanalyzerDoc ,
20
20
Run : func (pass * analysis.Pass ) (any , error ) {
21
- runGodox (pass , settings )
22
-
23
- return nil , nil
21
+ return runGodox (pass , settings ), nil
24
22
},
25
23
}
26
24
@@ -32,14 +30,18 @@ func New(settings *config.GodoxSettings) *goanalysis.Linter {
32
30
).WithLoadMode (goanalysis .LoadModeSyntax )
33
31
}
34
32
35
- func runGodox (pass * analysis.Pass , settings * config.GodoxSettings ) {
33
+ func runGodox (pass * analysis.Pass , settings * config.GodoxSettings ) error {
36
34
for _ , file := range pass .Files {
37
35
position , isGoFile := goanalysis .GetGoFilePosition (pass , file )
38
36
if ! isGoFile {
39
37
continue
40
38
}
41
39
42
- messages := godox .Run (file , pass .Fset , settings .Keywords ... )
40
+ messages , err := godox .Run (file , pass .Fset , settings .Keywords ... )
41
+ if err != nil {
42
+ return err
43
+ }
44
+
43
45
if len (messages ) == 0 {
44
46
continue
45
47
}
@@ -55,4 +57,6 @@ func runGodox(pass *analysis.Pass, settings *config.GodoxSettings) {
55
57
})
56
58
}
57
59
}
60
+
61
+ return nil
58
62
}
You can’t perform that action at this time.
0 commit comments