Skip to content

Commit 750b4ba

Browse files
authored
Fix forbidigo linter name in reports (#1590)
Fix cut-and-paste error with linter name. Fixes #1589
1 parent 64d823c commit 750b4ba

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/golinters/forbidigo.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ import (
1212
"github.com/golangci/golangci-lint/pkg/result"
1313
)
1414

15-
const forbidigoName = "forbidigo"
16-
1715
func NewForbidigo() *goanalysis.Linter {
16+
const linterName = "forbidigo"
1817
var mu sync.Mutex
1918
var resIssues []goanalysis.Issue
2019

2120
analyzer := &analysis.Analyzer{
22-
Name: forbidigoName,
21+
Name: linterName,
2322
Doc: goanalysis.TheOnlyanalyzerDoc,
2423
}
2524
return goanalysis.NewLinter(
26-
forbidigoName,
25+
linterName,
2726
"Forbids identifiers",
2827
[]*analysis.Analyzer{analyzer},
2928
nil,
@@ -34,7 +33,7 @@ func NewForbidigo() *goanalysis.Linter {
3433
var res []goanalysis.Issue
3534
forbid, err := forbidigo.NewLinter(s.Forbid)
3635
if err != nil {
37-
return nil, errors.Wrapf(err, "failed to create linter %q", forbidigoName)
36+
return nil, errors.Wrapf(err, "failed to create linter %q", linterName)
3837
}
3938

4039
for _, file := range pass.Files {
@@ -46,7 +45,7 @@ func NewForbidigo() *goanalysis.Linter {
4645
res = append(res, goanalysis.NewIssue(&result.Issue{
4746
Pos: hint.Position(),
4847
Text: hint.Details(),
49-
FromLinter: makezeroName,
48+
FromLinter: linterName,
5049
}, pass))
5150
}
5251
}

0 commit comments

Comments
 (0)