Skip to content

Commit 9bbcdf2

Browse files
committed
chore: update implementation
1 parent 5c76962 commit 9bbcdf2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pkg/golinters/godox/godox.go

+9-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ func New(settings *config.GodoxSettings) *goanalysis.Linter {
1818
Name: linterName,
1919
Doc: goanalysis.TheOnlyanalyzerDoc,
2020
Run: func(pass *analysis.Pass) (any, error) {
21-
runGodox(pass, settings)
22-
23-
return nil, nil
21+
return runGodox(pass, settings), nil
2422
},
2523
}
2624

@@ -32,14 +30,18 @@ func New(settings *config.GodoxSettings) *goanalysis.Linter {
3230
).WithLoadMode(goanalysis.LoadModeSyntax)
3331
}
3432

35-
func runGodox(pass *analysis.Pass, settings *config.GodoxSettings) {
33+
func runGodox(pass *analysis.Pass, settings *config.GodoxSettings) error {
3634
for _, file := range pass.Files {
3735
position, isGoFile := goanalysis.GetGoFilePosition(pass, file)
3836
if !isGoFile {
3937
continue
4038
}
4139

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+
4345
if len(messages) == 0 {
4446
continue
4547
}
@@ -55,4 +57,6 @@ func runGodox(pass *analysis.Pass, settings *config.GodoxSettings) {
5557
})
5658
}
5759
}
60+
61+
return nil
5862
}

0 commit comments

Comments
 (0)