Skip to content

Commit 4b05170

Browse files
build(deps): bump github.com/matoous/godox from 0.0.0-20230222163458-006bad1f9d26 to 1.1.0 (#5355)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent 98c110b commit 4b05170

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ require (
7474
github.com/macabu/inamedparam v0.1.3
7575
github.com/maratori/testableexamples v1.0.0
7676
github.com/maratori/testpackage v1.1.1
77-
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26
77+
github.com/matoous/godox v1.1.0
7878
github.com/mattn/go-colorable v0.1.14
7979
github.com/mgechev/revive v1.6.0
8080
github.com/mitchellh/go-homedir v1.1.0

go.sum

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/godox/godox.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,30 @@ 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 run(pass, settings), nil
2422
},
2523
}
2624

2725
return goanalysis.NewLinter(
2826
linterName,
29-
"Tool for detection of FIXME, TODO and other comment keywords",
27+
"Detects usage of FIXME, TODO and other keywords inside comments",
3028
[]*analysis.Analyzer{analyzer},
3129
nil,
3230
).WithLoadMode(goanalysis.LoadModeSyntax)
3331
}
3432

35-
func runGodox(pass *analysis.Pass, settings *config.GodoxSettings) {
33+
func run(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)