Skip to content

Commit

Permalink
Fix linter issue.
Browse files Browse the repository at this point in the history
Fix an issue reported by the golang linter in the test file.

Signed-off-by: José Guilherme Vanz <[email protected]>
  • Loading branch information
jvanz committed Mar 22, 2023
1 parent f744364 commit 3522f76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestSettingsAreValid(t *testing.T) {
}
`,
wantError: true,
error: "allowedUnsafeSysctls doesn't accept patterns with `*`",
error: "allowedUnsafeSysctls doesn't accept patterns with `*`",
},
{
name: "globs need to be suffix",
Expand All @@ -116,7 +116,7 @@ func TestSettingsAreValid(t *testing.T) {
}
`,
wantError: true,
error: "forbiddenSysctls only accepts patterns with `*` as suffix",
error: "forbiddenSysctls only accepts patterns with `*` as suffix",
},
{
name: "sysctl in both fields",
Expand All @@ -130,16 +130,16 @@ func TestSettingsAreValid(t *testing.T) {
}
`,
wantError: true,
error: "these sysctls cannot be allowed and forbidden at the same time: net.core.somaxconn",
error: "these sysctls cannot be allowed and forbidden at the same time: net.core.somaxconn",
},
} {
t.Run(tcase.name, func(t *testing.T) {
rawRequest := []byte(tcase.request)

settings, err := NewSettingsFromValidationReq(rawRequest)
settings, _ := NewSettingsFromValidationReq(rawRequest)
valid, err := settings.Valid()

if (err != nil) {
if err != nil {
if !tcase.wantError {
t.Errorf("on test %q, got unexpected error '%v'", tcase.name, err)
} else {
Expand Down

0 comments on commit 3522f76

Please sign in to comment.