Skip to content

Commit 9d272d7

Browse files
committed
Fix lint
1 parent 9844d94 commit 9d272d7

5 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎.golangci.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ linters:
4141
- musttag
4242
- nestif
4343
- nlreturn
44+
- noctx
45+
- noinlineerr
4446
- paralleltest
4547
- perfsprint
4648
- promlinter
@@ -51,6 +53,7 @@ linters:
5153
- varnamelen
5254
- wrapcheck
5355
- wsl
56+
- wsl_v5
5457

5558
settings: # please keep this alphabetized
5659
staticcheck:

‎main.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ func sleepForever() {
13001300
// exits the process with the exit code.
13011301
//
13021302
//nolint:unparam
1303-
func fatalConfigErrorf(log *logging.Logger, printUsage bool, format string, a ...interface{}) {
1303+
func fatalConfigErrorf(log *logging.Logger, printUsage bool, format string, a ...any) {
13041304
s := fmt.Sprintf(format, a...)
13051305
fmt.Fprintln(os.Stderr, s)
13061306
if printUsage {
@@ -2164,7 +2164,7 @@ func (git *repoSync) CallAskPassURL(ctx context.Context) error {
21642164

21652165
username := ""
21662166
password := ""
2167-
for _, line := range strings.Split(string(authData), "\n") {
2167+
for line := range strings.SplitSeq(string(authData), "\n") {
21682168
keyValues := strings.SplitN(line, "=", 2)
21692169
if len(keyValues) != 2 {
21702170
continue

‎pkg/cmd/cmd.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ type Runner struct {
3636

3737
// Just the logr methods we need in this package.
3838
type logintf interface {
39-
Info(msg string, keysAndValues ...interface{})
40-
Error(err error, msg string, keysAndValues ...interface{})
39+
Info(msg string, keysAndValues ...any)
40+
Error(err error, msg string, keysAndValues ...any)
4141
V(level int) logr.Logger
4242
WithCallDepth(depth int) logr.Logger
4343
}

‎pkg/hook/hook.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ type HookRunner struct {
114114

115115
// Just the logr methods we need in this package.
116116
type logintf interface {
117-
Info(msg string, keysAndValues ...interface{})
118-
Error(err error, msg string, keysAndValues ...interface{})
117+
Info(msg string, keysAndValues ...any)
118+
Error(err error, msg string, keysAndValues ...any)
119119
V(level int) logr.Logger
120120
}
121121

‎pkg/logging/logging.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ func New(root string, errorFile string, verbosity int) *Logger {
4646
}
4747

4848
// Error implements logr.Logger.Error.
49-
func (l *Logger) Error(err error, msg string, kvList ...interface{}) {
49+
func (l *Logger) Error(err error, msg string, kvList ...any) {
5050
l.Logger.WithCallDepth(1).Error(err, msg, kvList...)
5151
if l.errorFile == "" {
5252
return
5353
}
5454
payload := struct {
5555
Msg string
5656
Err string
57-
Args map[string]interface{}
57+
Args map[string]any
5858
}{
5959
Msg: msg,
60-
Args: map[string]interface{}{},
60+
Args: map[string]any{},
6161
}
6262
if err != nil {
6363
payload.Err = err.Error()

0 commit comments

Comments
 (0)