Skip to content

Commit

Permalink
chore: fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Aug 21, 2024
1 parent c5e610f commit b87cdc6
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 209 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ linters:
- govet
- importas
- lll
- megacheck
- gosimple
- staticcheck
- unused
- misspell
- nakedret
- nilerr
Expand Down
8 changes: 4 additions & 4 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,11 @@ func checkForRBACResources(content reconcilerUtils.KongRawState,
common := "At a time, state file(s) must entirely consist of either proxy " +
"configuration or RBAC configuration."
if rbacResourcesOnly {
return fmt.Errorf("When --rbac-resources-only is used, state file(s) " +
"cannot contain any resources other than RBAC resources. " + common)
return fmt.Errorf("when --rbac-resources-only is used, state file(s) "+
"cannot contain any resources other than RBAC resources. %s", common)
}
return fmt.Errorf("State file(s) contains RBAC resources. " +
"Please use --rbac-resources-only flag to manage these resources. " + common)
return fmt.Errorf("state file(s) contains RBAC resources. "+
"Please use --rbac-resources-only flag to manage these resources. %s", common)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion kong2kic/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func WriteContentToFile(content *file.Content, filename string, format file.Form
return err
}
default:
return fmt.Errorf("unknown file format: " + string(format))
return fmt.Errorf("unknown file format: %s", format)
}

if filename == "-" {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func Test_LintStructured(t *testing.T) {
cmpopts.EquateEmpty(),
}
if diff := cmp.Diff(outputErrors, expectedErrors, cmpOpts...); diff != "" {
t.Errorf(diff)
t.Errorf("got unexpected diff\n:%s", diff)
}
})
}
Expand Down
12 changes: 3 additions & 9 deletions tests/integration/reset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ u8S6yNlu2Q==
func Test_Reset_SkipCACert_2x(t *testing.T) {
// setup stage
client, err := getTestClient()
if err != nil {
t.Errorf(err.Error())
}
require.NoError(t, err)

tests := []struct {
name string
Expand Down Expand Up @@ -75,9 +73,7 @@ func Test_Reset_SkipCACert_2x(t *testing.T) {
func Test_Reset_SkipCACert_3x(t *testing.T) {
// setup stage
client, err := getTestClient()
if err != nil {
t.Errorf(err.Error())
}
require.NoError(t, err)

tests := []struct {
name string
Expand Down Expand Up @@ -113,9 +109,7 @@ func Test_Reset_ConsumerGroupConsumersWithCustomID(t *testing.T) {
setup(t)

client, err := getTestClient()
if err != nil {
t.Fatalf(err.Error())
}
require.NoError(t, err)

require.NoError(t, sync("testdata/sync/028-consumer-group-consumers-custom_id/kong.yaml"))
reset(t)
Expand Down
Loading

0 comments on commit b87cdc6

Please sign in to comment.