Skip to content

Commit 85f9073

Browse files
dependabot[bot]ldez
authored andcommitted
build(deps): bump github.com/nishanths/exhaustive from 0.8.1 to 0.8.3 (golangci#3207)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent 1bf8c70 commit 85f9073

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

.golangci.reference.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,12 @@ linters-settings:
307307
# Consider enums only in package scopes, not in inner scopes.
308308
# Default: false
309309
package-scope-only: true
310+
# only run exhaustive check on switches with "//exhaustive:enforce" comment
311+
# Default: false
312+
explicit-exhaustive-switch: true
313+
# only run exhaustive check on map literals with "//exhaustive:enforce" comment.
314+
# Default: false
315+
explicit-exhaustive-map: true
310316

311317
exhaustivestruct:
312318
# Struct Patterns is list of expressions to match struct packages and names.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ require (
6969
github.com/mitchellh/go-ps v1.0.0
7070
github.com/moricho/tparallel v0.2.1
7171
github.com/nakabonne/nestif v0.3.1
72-
github.com/nishanths/exhaustive v0.8.1
72+
github.com/nishanths/exhaustive v0.8.3
7373
github.com/nishanths/predeclared v0.2.2
7474
github.com/pkg/errors v0.9.1
7575
github.com/polyfloyd/go-errorlint v1.0.3

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ type ExhaustiveSettings struct {
278278
DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"`
279279
IgnoreEnumMembers string `mapstructure:"ignore-enum-members"`
280280
PackageScopeOnly bool `mapstructure:"package-scope-only"`
281+
ExplicitExhaustiveMap bool `mapstructure:"explicit-exhaustive-map"`
282+
ExplicitExhaustiveSwitch bool `mapstructure:"explicit-exhaustive-switch"`
281283
}
282284

283285
type ExhaustiveStructSettings struct {

pkg/golinters/exhaustive.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter {
1717
a.Name: {
1818
exhaustive.CheckGeneratedFlag: settings.CheckGenerated,
1919
exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive,
20+
exhaustive.ExplicitExhaustiveMapFlag: settings.ExplicitExhaustiveMap,
21+
exhaustive.ExplicitExhaustiveSwitchFlag: settings.PackageScopeOnly,
2022
exhaustive.IgnoreEnumMembersFlag: settings.IgnoreEnumMembers,
21-
exhaustive.PackageScopeOnlyFlag: settings.PackageScopeOnly,
2223
},
2324
}
2425
}

0 commit comments

Comments
 (0)