Skip to content

Commit b20faca

Browse files
committed
chore: enable modernize golangci-lint linter
Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
1 parent 5f0c9e8 commit b20faca

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ linters:
5252
- makezero
5353
- misspell
5454
- mnd
55+
- modernize
5556
- nakedret
5657
- nestif
5758
- nilerr
@@ -111,6 +112,10 @@ linters:
111112
always: true
112113
misspell:
113114
locale: US
115+
modernize:
116+
disable:
117+
# to avoid conflict with `--fix`
118+
- omitzero
114119
nolintlint:
115120
allow-unused: false
116121
allow-no-explanation: []

e2e/util_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
// assertExpectedAndActual is a helper function to allow the step function to call
2727
// assertion functions where you want to compare an expected and an actual value.
2828
func assertExpectedAndActual(a expectedAndActualAssertion,
29-
expected, actual interface{}, msgAndArgs ...interface{},
29+
expected, actual any, msgAndArgs ...any,
3030
) error {
3131
var t asserter
3232

@@ -36,12 +36,12 @@ func assertExpectedAndActual(a expectedAndActualAssertion,
3636
}
3737

3838
type expectedAndActualAssertion func(t assert.TestingT,
39-
expected, actual interface{}, msgAndArgs ...interface{}) bool
39+
expected, actual any, msgAndArgs ...any) bool
4040

4141
// assertActual is a helper function to allow the step function to call
4242
// assertion functions where you want to compare an actual value to a
4343
// predefined state like nil, empty or true/false.
44-
func assertActual(a actualAssertion, actual interface{}) error {
44+
func assertActual(a actualAssertion, actual any) error {
4545
var t asserter
4646

4747
a(&t, actual)
@@ -52,8 +52,8 @@ func assertActual(a actualAssertion, actual interface{}) error {
5252
// assertExpectedLenAndActual is a helper function to allow the step function to call
5353
// assertion functions where you want to compare an actual value to a
5454
// has specific length.
55-
func assertExpectedLenAndActual(a func(t assert.TestingT, object interface{},
56-
length int, msgAndArgs ...interface{}) bool, actual interface{}, length int, msgAndArgs ...interface{},
55+
func assertExpectedLenAndActual(a func(t assert.TestingT, object any,
56+
length int, msgAndArgs ...any) bool, actual any, length int, msgAndArgs ...any,
5757
) error {
5858
var t asserter
5959

@@ -62,7 +62,7 @@ func assertExpectedLenAndActual(a func(t assert.TestingT, object interface{},
6262
return t.err
6363
}
6464

65-
type actualAssertion func(t assert.TestingT, actual interface{}, msgAndArgs ...interface{}) bool
65+
type actualAssertion func(t assert.TestingT, actual any, msgAndArgs ...any) bool
6666

6767
// asserter is used to be able to retrieve the error reported by the called assertion.
6868
type asserter struct {
@@ -72,6 +72,6 @@ type asserter struct {
7272
// Errorf is used by the called assertion to report an error.
7373
//
7474
//nolint:err113
75-
func (a *asserter) Errorf(format string, args ...interface{}) {
75+
func (a *asserter) Errorf(format string, args ...any) {
7676
a.err = fmt.Errorf(format, args...)
7777
}

0 commit comments

Comments
 (0)