File tree Expand file tree Collapse file tree 5 files changed +18
-12
lines changed Expand file tree Collapse file tree 5 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,9 @@ linters-settings:
294294 # See the https://github.com/polyfloyd/go-errorlint for caveats.
295295 # Default: true
296296 errorf : false
297+ # Permit more than 1 %w verb, valid per Go 1.20 (Requires errorf:true)
298+ # Default: true
299+ errorf-multi : false
297300 # Check for plain type assertions and type switches.
298301 # Default: true
299302 asserts : false
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ require (
7575 github.com/nishanths/exhaustive v0.9.5
7676 github.com/nishanths/predeclared v0.2.2
7777 github.com/nunnatsa/ginkgolinter v0.8.1
78- github.com/polyfloyd/go-errorlint v1.1 .0
78+ github.com/polyfloyd/go-errorlint v1.2 .0
7979 github.com/quasilyte/go-ruleguard/dsl v0.3.22
8080 github.com/ryancurrah/gomodguard v1.3.0
8181 github.com/ryanrolds/sqlclosecheck v0.4.0
Original file line number Diff line number Diff line change @@ -19,9 +19,10 @@ var defaultLintersSettings = LintersSettings{
1919 MaxBlankIdentifiers : 2 ,
2020 },
2121 ErrorLint : ErrorLintSettings {
22- Errorf : true ,
23- Asserts : true ,
24- Comparison : true ,
22+ Errorf : true ,
23+ ErrorfMulti : true ,
24+ Asserts : true ,
25+ Comparison : true ,
2526 },
2627 Exhaustive : ExhaustiveSettings {
2728 Check : []string {"switch" },
@@ -280,9 +281,10 @@ type ErrChkJSONSettings struct {
280281}
281282
282283type ErrorLintSettings struct {
283- Errorf bool `mapstructure:"errorf"`
284- Asserts bool `mapstructure:"asserts"`
285- Comparison bool `mapstructure:"comparison"`
284+ Errorf bool `mapstructure:"errorf"`
285+ ErrorfMulti bool `mapstructure:"errorf-multi"`
286+ Asserts bool `mapstructure:"asserts"`
287+ Comparison bool `mapstructure:"comparison"`
286288}
287289
288290type ExhaustiveSettings struct {
Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ func NewErrorLint(cfg *config.ErrorLintSettings) *goanalysis.Linter {
1515
1616 if cfg != nil {
1717 cfgMap [a .Name ] = map [string ]interface {}{
18- "errorf" : cfg .Errorf ,
19- "asserts" : cfg .Asserts ,
20- "comparison" : cfg .Comparison ,
18+ "errorf" : cfg .Errorf ,
19+ "errorf-multi" : cfg .ErrorfMulti ,
20+ "asserts" : cfg .Asserts ,
21+ "comparison" : cfg .Comparison ,
2122 }
2223 }
2324
You can’t perform that action at this time.
0 commit comments