Skip to content

Commit

Permalink
Enable the unconvert linter.
Browse files Browse the repository at this point in the history
Update the code according to the linter rules.
  • Loading branch information
opudrovs committed Mar 15, 2023
1 parent 598c4ef commit 8139a7a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ linters:
#- thelper
#- tparallel
- typecheck
#- unconvert
- unconvert
- unparam
- unused
- varcheck
Expand Down
2 changes: 1 addition & 1 deletion core/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type LogOption func(*zap.Config)
// WithLogLevel will set the log level on the Logger Config
func WithLogLevel(l zapcore.Level) LogOption {
return func(c *zap.Config) {
c.Level = zap.NewAtomicLevelAt(zapcore.Level(l))
c.Level = zap.NewAtomicLevelAt(l)
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/services/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ func extractSecretPart(secret *corev1.Secret, key string) []byte {

var ok bool

data, ok = secret.Data[string(key)]
data, ok = secret.Data[key]
if !ok {
// StringData is a write-only field, flux generates secrets on disk with StringData
// Once they get applied on the cluster, Kubernetes populates Data and removes StringData.
// Handle this case here to be able to extract data no matter the "state" of the object.
data = []byte(secret.StringData[string(key)])
data = []byte(secret.StringData[key])
}

return data
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutils/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func MakeJWToken(t *testing.T, key *rsa.PrivateKey, email string, opts ...func(m
Audience: jwt.Audience{"test-service"},
NotBefore: jwt.NewNumericDate(notBefore),
IssuedAt: jwt.NewNumericDate(notBefore),
Expiry: jwt.NewNumericDate(notBefore.Add(time.Duration(maxAgeSecondsAuthCookie))),
Expiry: jwt.NewNumericDate(notBefore.Add(maxAgeSecondsAuthCookie)),
}
extraClaims := map[string]any{
"groups": []string{"testing"},
Expand Down

0 comments on commit 8139a7a

Please sign in to comment.