Skip to content

Commit

Permalink
analyzer: set diagnostics category (#228)
Browse files Browse the repository at this point in the history
This allows wrapping errcheck.Analyzer with nolint.Wrap to silence
diagnostics with //nolint:errcheck comments.

Link: https://github.com/kyoh86/nolint

Signed-off-by: Robin Jarry <[email protected]>
  • Loading branch information
rjarry authored Feb 24, 2023
1 parent d116ada commit 014db21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions errcheck/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func init() {
}

func runAnalyzer(pass *analysis.Pass) (interface{}, error) {

exclude := map[string]bool{}
if !argExcludeOnly {
for _, name := range DefaultExcludedSymbols {
Expand Down Expand Up @@ -65,8 +64,9 @@ func runAnalyzer(pass *analysis.Pass) (interface{}, error) {

for _, err := range v.errors {
pass.Report(analysis.Diagnostic{
Pos: pass.Fset.File(f.Pos()).Pos(err.Pos.Offset),
Message: "unchecked error",
Pos: pass.Fset.File(f.Pos()).Pos(err.Pos.Offset),
Message: "unchecked error",
Category: "errcheck",
})
}

Expand Down

0 comments on commit 014db21

Please sign in to comment.