File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1159,6 +1159,10 @@ linters-settings:
11591159 require-specific : true
11601160
11611161 nonamedreturns :
1162+ # Report named error if it is assigned inside defer.
1163+ # Default: false
1164+ report-error-in-defer : true
1165+ # DEPRECATED use report-error-in-defer instead.
11621166 # Do not complain about named error, if it is assigned inside defer.
11631167 # Default: false
11641168 allow-error-in-defer : true
Original file line number Diff line number Diff line change @@ -486,7 +486,8 @@ type NoLintLintSettings struct {
486486}
487487
488488type NoNamedReturnsSettings struct {
489- AllowErrorInDefer bool `mapstructure:"allow-error-in-defer"`
489+ AllowErrorInDefer bool `mapstructure:"allow-error-in-defer"` // Deprecated: use ReportErrorInDefer instead.
490+ ReportErrorInDefer bool `mapstructure:"report-error-in-defer"`
490491}
491492type ParallelTestSettings struct {
492493 IgnoreMissing bool `mapstructure:"ignore-missing"`
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ func NewNoNamedReturns(settings *config.NoNamedReturnsSettings) *goanalysis.Lint
1515 if settings != nil {
1616 cfg = map [string ]map [string ]interface {}{
1717 a .Name : {
18- analyzer .FlagAllowErrorInDefer : settings .AllowErrorInDefer ,
18+ analyzer .FlagReportErrorInDefer : settings . ReportErrorInDefer || settings .AllowErrorInDefer ,
1919 },
2020 }
2121 }
Original file line number Diff line number Diff line change 11linters-settings :
22 nonamedreturns :
3- allow -error-in-defer : true
3+ report -error-in-defer : true
You can’t perform that action at this time.
0 commit comments