Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Aug 14, 2024
1 parent beefc7f commit e88741b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
issues:
exclude-dirs:
- pkg/kube/labels
- pkg/kube/labels

linters-settings:
govet:
disable:
# printf: non-constant format string in call to fmt.Errorf (govet)
# showing up since golangci-lint version 1.60.1
- printf
4 changes: 2 additions & 2 deletions connection/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ func (t *AWSConnection) Populate(ctx ConnectionContext) error {
}

if secretKey, err := ctx.GetEnvValueFromCache(t.SecretKey, ""); err != nil {
return fmt.Errorf(fmt.Sprintf("Could not parse AWS secret access key: %v", err))
return fmt.Errorf("could not parse AWS secret access key: %w", err)
} else {
t.SecretKey.ValueStatic = secretKey
}

if sessionToken, err := ctx.GetEnvValueFromCache(t.SessionToken, ""); err != nil {
return fmt.Errorf(fmt.Sprintf("Could not parse AWS session token: %v", err))
return fmt.Errorf("could not parse AWS session token: %w", err)
} else {
t.SessionToken.ValueStatic = sessionToken
}
Expand Down
3 changes: 2 additions & 1 deletion models/job_history.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package models

import (
"errors"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -56,7 +57,7 @@ func (j JobHistory) AsError() error {
if len(j.Errors) == 0 {
return nil
}
return fmt.Errorf(strings.Join(j.Errors, ","))
return errors.New(strings.Join(j.Errors, ","))
}

func (j JobHistory) TableName() string {
Expand Down

0 comments on commit e88741b

Please sign in to comment.