We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f851497 commit 6cd10a9Copy full SHA for 6cd10a9
pkg/goanalysis/linter.go
@@ -76,6 +76,25 @@ func (lnt *Linter) WithDesc(desc string) *Linter {
76
return lnt
77
}
78
79
+func (lnt *Linter) WithVersion(v int) *Linter {
80
+ if v == 0 {
81
+ return lnt
82
+ }
83
+
84
+ for _, analyzer := range lnt.analyzers {
85
+ if lnt.name != analyzer.Name {
86
+ continue
87
88
89
+ // The analyzer name should be the same as the linter name to avoid displaying the name inside the reports.
90
+ analyzer.Name = fmt.Sprintf("%s_v%d", analyzer.Name, v)
91
92
93
+ lnt.name = fmt.Sprintf("%s_v%d", lnt.name, v)
94
95
96
+}
97
98
func (lnt *Linter) WithConfig(cfg map[string]any) *Linter {
99
if len(cfg) == 0 {
100
0 commit comments