You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doc: "Source code linter for Go software that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.",
22
-
Run: run,
23
-
Flags: flagSet,
18
+
a:=&analysis.Analyzer{
19
+
Name: "errorlint",
20
+
Doc: "Source code linter for Go software that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.",
21
+
Run: run,
24
22
}
23
+
24
+
a.Flags.BoolVar(&checkComparison, "comparison", true, "Check for plain error comparisons")
25
+
a.Flags.BoolVar(&checkAsserts, "asserts", true, "Check for plain type assertions and type switches")
26
+
a.Flags.BoolVar(&checkErrorf, "errorf", false, "Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats")
27
+
a.Flags.BoolVar(&checkErrorfMulti, "errorf-multi", true, "Permit more than 1 %w verb, valid per Go 1.20 (Requires -errorf=true)")
28
+
29
+
returna
25
30
}
26
31
27
32
var (
28
-
flagSet flag.FlagSet
29
33
checkComparisonbool
30
34
checkAssertsbool
31
35
checkErrorfbool
32
36
checkErrorfMultibool
33
37
)
34
38
35
-
funcinit() {
36
-
flagSet.BoolVar(&checkComparison, "comparison", true, "Check for plain error comparisons")
37
-
flagSet.BoolVar(&checkAsserts, "asserts", true, "Check for plain type assertions and type switches")
38
-
flagSet.BoolVar(&checkErrorf, "errorf", false, "Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats")
39
-
flagSet.BoolVar(&checkErrorfMulti, "errorf-multi", true, "Permit more than 1 %w verb, valid per Go 1.20 (Requires -errorf=true)")
0 commit comments