From 3522f7671e31821411113819b17208b892b0d141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Guilherme=20Vanz?= Date: Wed, 22 Mar 2023 15:24:02 -0300 Subject: [PATCH] Fix linter issue. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix an issue reported by the golang linter in the test file. Signed-off-by: José Guilherme Vanz --- settings_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/settings_test.go b/settings_test.go index 5006cca..e99cbf2 100644 --- a/settings_test.go +++ b/settings_test.go @@ -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", @@ -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", @@ -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 {