From 468780be00a63a677b38263c5059f0cc14d7a66e Mon Sep 17 00:00:00 2001 From: Anthony Gomez Date: Wed, 7 Oct 2026 12:48:00 -0400 Subject: [PATCH 1/3] lint fixes, mostly gofumpt and gosec exemptions --- pkg/commands/auth/metadata_test.go | 4 ++-- pkg/commands/auth/revoke_test.go | 2 +- pkg/commands/auth/sso_test.go | 2 +- .../compute/computeacl/computeacl_test.go | 10 +++++----- pkg/commands/dashboard/item/delete.go | 2 +- pkg/commands/ip/ip_test.go | 8 ++++---- .../ngwaf/customsignal/customsignal_test.go | 6 +++--- pkg/commands/ngwaf/iplist/iplist_test.go | 6 +++--- pkg/commands/ngwaf/rule/rule_test.go | 8 ++++---- .../ngwaf/signallist/signallist_test.go | 6 +++--- .../ngwaf/stringlist/stringlist_test.go | 6 +++--- .../ngwaf/wildcardlist/wildcardlist_test.go | 6 +++--- .../workspace/alert/datadog/datadog_test.go | 18 +++++++++--------- .../ngwaf/workspace/alert/jira/jira_test.go | 12 ++++++------ .../alert/mailinglist/mailinglist_test.go | 8 ++++---- .../microsoftteams/microsoftteams_test.go | 8 ++++---- .../workspace/alert/opsgenie/opsgenie_test.go | 10 +++++----- .../alert/pagerduty/pagerduty_test.go | 8 ++++---- .../ngwaf/workspace/alert/slack/slack_test.go | 8 ++++---- .../workspace/alert/webhook/webhook_test.go | 16 ++++++++-------- .../workspace/countrylist/countrylist_test.go | 6 +++--- .../customsignal/customsignal_test.go | 6 +++--- pkg/commands/ngwaf/workspace/rule/rule_test.go | 8 ++++---- .../workspace/signallist/signallist_test.go | 6 +++--- .../workspace/stringlist/stringlist_test.go | 6 +++--- .../workspace/threshold/threshold_test.go | 6 +++--- .../virtualpatch/virtualpatch_test.go | 4 ++-- .../wildcardlist/wildcardlist_test.go | 6 +++--- pkg/commands/ngwaf/workspace/workspace_test.go | 6 +++--- .../accesskeys/accesskeys_test.go | 6 +++--- .../service/healthcheck/healthcheck_test.go | 2 +- pkg/global/global_test.go | 4 ++-- 32 files changed, 110 insertions(+), 110 deletions(-) diff --git a/pkg/commands/auth/metadata_test.go b/pkg/commands/auth/metadata_test.go index cc3fb628e..0065eae0a 100644 --- a/pkg/commands/auth/metadata_test.go +++ b/pkg/commands/auth/metadata_test.go @@ -267,7 +267,7 @@ func TestAuthShow(t *testing.T) { Auth: config.Auth{ Default: "mytoken", Tokens: config.AuthTokens{ - "mytoken": &config.AuthToken{ + "mytoken": &config.AuthToken{ // #nosec G101 (CWE-798) Type: config.AuthTokenTypeStatic, Token: "test-token-value", Email: "alice@example.com", @@ -495,7 +495,7 @@ func TestEnrichWithTokenSelfPreservesOnFailure(t *testing.T) { }, }) - at := &config.AuthToken{ + at := &config.AuthToken{ // #nosec G101 (CWE-798) Token: "existing-token", APITokenName: "original-name", APITokenScope: "global", diff --git a/pkg/commands/auth/revoke_test.go b/pkg/commands/auth/revoke_test.go index 911bf365e..fd4e10250 100644 --- a/pkg/commands/auth/revoke_test.go +++ b/pkg/commands/auth/revoke_test.go @@ -235,7 +235,7 @@ func TestAuthRevoke(t *testing.T) { Default: "other", Tokens: config.AuthTokens{ "other": &config.AuthToken{Type: config.AuthTokenTypeStatic, Token: "other-tok"}, - "target": &config.AuthToken{Type: config.AuthTokenTypeStatic, Token: "tok-from-stdin"}, + "target": &config.AuthToken{Type: config.AuthTokenTypeStatic, Token: "tok-from-stdin"}, // #nosec G101 (CWE-798) }, }, }, diff --git a/pkg/commands/auth/sso_test.go b/pkg/commands/auth/sso_test.go index 19def9cdb..5231f85c9 100644 --- a/pkg/commands/auth/sso_test.go +++ b/pkg/commands/auth/sso_test.go @@ -670,7 +670,7 @@ func TestSSO(t *testing.T) { Result: result, } go func() { - result <- auth.AuthorizationResult{ + result <- auth.AuthorizationResult{ // #nosec G101 (CWE-798) SessionToken: "sso-env-token", } }() diff --git a/pkg/commands/compute/computeacl/computeacl_test.go b/pkg/commands/compute/computeacl/computeacl_test.go index 605bc921e..f1604137e 100644 --- a/pkg/commands/compute/computeacl/computeacl_test.go +++ b/pkg/commands/compute/computeacl/computeacl_test.go @@ -53,7 +53,7 @@ func TestComputeACLCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(acl)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(acl))), }, }, }, @@ -181,7 +181,7 @@ func TestComputeACLDescribe(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(acl)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(acl))), }, }, }, @@ -195,7 +195,7 @@ func TestComputeACLDescribe(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(acl)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(acl))), }, }, }, @@ -364,7 +364,7 @@ func TestComputeACLLookup(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(entry)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(entry))), }, }, }, @@ -378,7 +378,7 @@ func TestComputeACLLookup(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(entry)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(entry))), }, }, }, diff --git a/pkg/commands/dashboard/item/delete.go b/pkg/commands/dashboard/item/delete.go index 4a508c7b7..b8aa553cb 100644 --- a/pkg/commands/dashboard/item/delete.go +++ b/pkg/commands/dashboard/item/delete.go @@ -80,7 +80,7 @@ func (c *DeleteCommand) Exec(_ io.Reader, out io.Writer) error { } if success { - text.Success(out, `Removed %d dashboard item(s) from Custom Dashboard "%s" (dashboardID: %s)`, (numItems - (len(d.Items))), d.Name, d.ID) + text.Success(out, `Removed %d dashboard item(s) from Custom Dashboard "%s" (dashboardID: %s)`, (numItems - len(d.Items)), d.Name, d.ID) } else { text.Warning(out, "dashboard (%s) has no item with ID (%s)", d.ID, c.itemID) } diff --git a/pkg/commands/ip/ip_test.go b/pkg/commands/ip/ip_test.go index 9194bf42c..ddf5f5518 100644 --- a/pkg/commands/ip/ip_test.go +++ b/pkg/commands/ip/ip_test.go @@ -18,10 +18,10 @@ func TestAllIPs(t *testing.T) { API: &mock.API{ AllIPsFn: func(_ context.Context) (v4, v6 fastly.IPAddrs, err error) { return []string{ - "00.123.45.6/78", - }, []string{ - "0a12:3b45::/67", - }, nil + "00.123.45.6/78", + }, []string{ + "0a12:3b45::/67", + }, nil }, }, WantOutput: "\nIPv4\n\t00.123.45.6/78\n\nIPv6\n\t0a12:3b45::/67\n", diff --git a/pkg/commands/ngwaf/customsignal/customsignal_test.go b/pkg/commands/ngwaf/customsignal/customsignal_test.go index 6e83b4230..ff648a192 100644 --- a/pkg/commands/ngwaf/customsignal/customsignal_test.go +++ b/pkg/commands/ngwaf/customsignal/customsignal_test.go @@ -61,7 +61,7 @@ func TestCustomSignalCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(customSignal)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(customSignal))), }, }, }, @@ -177,7 +177,7 @@ func TestCustomSignalGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(customSignal)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(customSignal))), }, }, }, @@ -191,7 +191,7 @@ func TestCustomSignalGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(customSignal)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(customSignal))), }, }, }, diff --git a/pkg/commands/ngwaf/iplist/iplist_test.go b/pkg/commands/ngwaf/iplist/iplist_test.go index 13ef31ec5..f59220dcf 100644 --- a/pkg/commands/ngwaf/iplist/iplist_test.go +++ b/pkg/commands/ngwaf/iplist/iplist_test.go @@ -83,7 +83,7 @@ func TestIPListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -199,7 +199,7 @@ func TestIPListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -213,7 +213,7 @@ func TestIPListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/rule/rule_test.go b/pkg/commands/ngwaf/rule/rule_test.go index 922cd1ecc..e8515b14f 100644 --- a/pkg/commands/ngwaf/rule/rule_test.go +++ b/pkg/commands/ngwaf/rule/rule_test.go @@ -89,7 +89,7 @@ func TestRuleCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(rule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(rule))), }, }, }, @@ -103,7 +103,7 @@ func TestRuleCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(complexRule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(complexRule))), }, }, }, @@ -219,7 +219,7 @@ func TestRuleGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(rule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(rule))), }, }, }, @@ -233,7 +233,7 @@ func TestRuleGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(rule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(rule))), }, }, }, diff --git a/pkg/commands/ngwaf/signallist/signallist_test.go b/pkg/commands/ngwaf/signallist/signallist_test.go index b8c45d05b..58ae84413 100644 --- a/pkg/commands/ngwaf/signallist/signallist_test.go +++ b/pkg/commands/ngwaf/signallist/signallist_test.go @@ -83,7 +83,7 @@ func TestSignalListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -199,7 +199,7 @@ func TestSignalListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -213,7 +213,7 @@ func TestSignalListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/stringlist/stringlist_test.go b/pkg/commands/ngwaf/stringlist/stringlist_test.go index f97e3257b..29878f26e 100644 --- a/pkg/commands/ngwaf/stringlist/stringlist_test.go +++ b/pkg/commands/ngwaf/stringlist/stringlist_test.go @@ -83,7 +83,7 @@ func TestStringListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -199,7 +199,7 @@ func TestStringListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -213,7 +213,7 @@ func TestStringListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/wildcardlist/wildcardlist_test.go b/pkg/commands/ngwaf/wildcardlist/wildcardlist_test.go index f79d816c3..47e21256f 100644 --- a/pkg/commands/ngwaf/wildcardlist/wildcardlist_test.go +++ b/pkg/commands/ngwaf/wildcardlist/wildcardlist_test.go @@ -83,7 +83,7 @@ func TestWildcardListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -199,7 +199,7 @@ func TestWildcardListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -213,7 +213,7 @@ func TestWildcardListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/datadog/datadog_test.go b/pkg/commands/ngwaf/workspace/alert/datadog/datadog_test.go index bd9c43744..51e9968dd 100644 --- a/pkg/commands/ngwaf/workspace/alert/datadog/datadog_test.go +++ b/pkg/commands/ngwaf/workspace/alert/datadog/datadog_test.go @@ -64,7 +64,7 @@ func TestDatadogAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(datadogAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(datadogAlert))), }, }, }, @@ -78,7 +78,7 @@ func TestDatadogAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(datadogAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(datadogAlert))), }, }, }, @@ -92,7 +92,7 @@ func TestDatadogAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(datadogAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(datadogAlert))), }, }, }, @@ -241,7 +241,7 @@ func TestDatadogAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(datadogAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(datadogAlert))), }, }, }, @@ -255,7 +255,7 @@ func TestDatadogAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(datadogAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(datadogAlert))), }, }, }, @@ -322,13 +322,13 @@ func TestDatadogAlertUpdate(t *testing.T) { { StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(datadogAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(datadogAlert))), }, // Second response for PATCH (updating alert) { StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(updatedAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(updatedAlert))), }, }, }, @@ -345,13 +345,13 @@ func TestDatadogAlertUpdate(t *testing.T) { { StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(datadogAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(datadogAlert))), }, // Second response for PATCH (updating alert) { StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(updatedAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(updatedAlert))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/jira/jira_test.go b/pkg/commands/ngwaf/workspace/alert/jira/jira_test.go index 4295c57d2..1f8d5c06a 100644 --- a/pkg/commands/ngwaf/workspace/alert/jira/jira_test.go +++ b/pkg/commands/ngwaf/workspace/alert/jira/jira_test.go @@ -80,7 +80,7 @@ func TestJiraAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(jiraAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(jiraAlert))), }, }, }, @@ -94,7 +94,7 @@ func TestJiraAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(jiraAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(jiraAlert))), }, }, }, @@ -108,7 +108,7 @@ func TestJiraAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(jiraAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(jiraAlert))), }, }, }, @@ -122,7 +122,7 @@ func TestJiraAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(jiraAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(jiraAlert))), }, }, }, @@ -277,7 +277,7 @@ func TestJiraAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(jiraAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(jiraAlert))), }, }, }, @@ -291,7 +291,7 @@ func TestJiraAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(jiraAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(jiraAlert))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/mailinglist/mailinglist_test.go b/pkg/commands/ngwaf/workspace/alert/mailinglist/mailinglist_test.go index 0d25e6e7f..49498f294 100644 --- a/pkg/commands/ngwaf/workspace/alert/mailinglist/mailinglist_test.go +++ b/pkg/commands/ngwaf/workspace/alert/mailinglist/mailinglist_test.go @@ -59,7 +59,7 @@ func TestMailingListAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(mailinglistAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(mailinglistAlert))), }, }, }, @@ -73,7 +73,7 @@ func TestMailingListAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(mailinglistAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(mailinglistAlert))), }, }, }, @@ -220,7 +220,7 @@ func TestMailingListAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(mailinglistAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(mailinglistAlert))), }, }, }, @@ -234,7 +234,7 @@ func TestMailingListAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(mailinglistAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(mailinglistAlert))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/microsoftteams/microsoftteams_test.go b/pkg/commands/ngwaf/workspace/alert/microsoftteams/microsoftteams_test.go index 94c2cb9c1..074c7ea36 100644 --- a/pkg/commands/ngwaf/workspace/alert/microsoftteams/microsoftteams_test.go +++ b/pkg/commands/ngwaf/workspace/alert/microsoftteams/microsoftteams_test.go @@ -57,7 +57,7 @@ func TestMicrosoftTeamsAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(teamsAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(teamsAlert))), }, }, }, @@ -71,7 +71,7 @@ func TestMicrosoftTeamsAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(teamsAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(teamsAlert))), }, }, }, @@ -218,7 +218,7 @@ func TestMicrosoftTeamsAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(teamsAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(teamsAlert))), }, }, }, @@ -232,7 +232,7 @@ func TestMicrosoftTeamsAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(teamsAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(teamsAlert))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/opsgenie/opsgenie_test.go b/pkg/commands/ngwaf/workspace/alert/opsgenie/opsgenie_test.go index 648cceb57..4e6db5198 100644 --- a/pkg/commands/ngwaf/workspace/alert/opsgenie/opsgenie_test.go +++ b/pkg/commands/ngwaf/workspace/alert/opsgenie/opsgenie_test.go @@ -57,7 +57,7 @@ func TestOpsgenieAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(opsgenieAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(opsgenieAlert))), }, }, }, @@ -71,7 +71,7 @@ func TestOpsgenieAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(opsgenieAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(opsgenieAlert))), }, }, }, @@ -85,7 +85,7 @@ func TestOpsgenieAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(opsgenieAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(opsgenieAlert))), }, }, }, @@ -232,7 +232,7 @@ func TestOpsgenieAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(opsgenieAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(opsgenieAlert))), }, }, }, @@ -246,7 +246,7 @@ func TestOpsgenieAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(opsgenieAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(opsgenieAlert))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/pagerduty/pagerduty_test.go b/pkg/commands/ngwaf/workspace/alert/pagerduty/pagerduty_test.go index 53d9937f5..d95133c4a 100644 --- a/pkg/commands/ngwaf/workspace/alert/pagerduty/pagerduty_test.go +++ b/pkg/commands/ngwaf/workspace/alert/pagerduty/pagerduty_test.go @@ -57,7 +57,7 @@ func TestPagerDutyAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(pagerdutyAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(pagerdutyAlert))), }, }, }, @@ -71,7 +71,7 @@ func TestPagerDutyAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(pagerdutyAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(pagerdutyAlert))), }, }, }, @@ -218,7 +218,7 @@ func TestPagerDutyAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(pagerdutyAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(pagerdutyAlert))), }, }, }, @@ -232,7 +232,7 @@ func TestPagerDutyAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(pagerdutyAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(pagerdutyAlert))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/slack/slack_test.go b/pkg/commands/ngwaf/workspace/alert/slack/slack_test.go index fcdfe3216..fac1478c8 100644 --- a/pkg/commands/ngwaf/workspace/alert/slack/slack_test.go +++ b/pkg/commands/ngwaf/workspace/alert/slack/slack_test.go @@ -57,7 +57,7 @@ func TestSlackAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(slackAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(slackAlert))), }, }, }, @@ -71,7 +71,7 @@ func TestSlackAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(slackAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(slackAlert))), }, }, }, @@ -218,7 +218,7 @@ func TestSlackAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(slackAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(slackAlert))), }, }, }, @@ -232,7 +232,7 @@ func TestSlackAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(slackAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(slackAlert))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/alert/webhook/webhook_test.go b/pkg/commands/ngwaf/workspace/alert/webhook/webhook_test.go index 83ec56415..45d35b048 100644 --- a/pkg/commands/ngwaf/workspace/alert/webhook/webhook_test.go +++ b/pkg/commands/ngwaf/workspace/alert/webhook/webhook_test.go @@ -58,7 +58,7 @@ func TestWebhookAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(webhookAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(webhookAlert))), }, }, }, @@ -72,7 +72,7 @@ func TestWebhookAlertCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusCreated, Status: http.StatusText(http.StatusCreated), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(webhookAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(webhookAlert))), }, }, }, @@ -219,7 +219,7 @@ func TestWebhookAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(webhookAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(webhookAlert))), }, }, }, @@ -233,7 +233,7 @@ func TestWebhookAlertGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(webhookAlert)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(webhookAlert))), }, }, }, @@ -426,7 +426,7 @@ func TestWebhookGetSigningKey(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(signingKeyResponse)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(signingKeyResponse))), }, }, }, @@ -440,7 +440,7 @@ func TestWebhookGetSigningKey(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(signingKeyResponse)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(signingKeyResponse))), }, }, }, @@ -495,7 +495,7 @@ func TestWebhookRotateSigningKey(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(signingKeyResponse)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(signingKeyResponse))), }, }, }, @@ -509,7 +509,7 @@ func TestWebhookRotateSigningKey(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(signingKeyResponse)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(signingKeyResponse))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/countrylist/countrylist_test.go b/pkg/commands/ngwaf/workspace/countrylist/countrylist_test.go index 800b3e5d7..ada17fb96 100644 --- a/pkg/commands/ngwaf/workspace/countrylist/countrylist_test.go +++ b/pkg/commands/ngwaf/workspace/countrylist/countrylist_test.go @@ -98,7 +98,7 @@ func TestCountryListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -240,7 +240,7 @@ func TestCountryListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -254,7 +254,7 @@ func TestCountryListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/customsignal/customsignal_test.go b/pkg/commands/ngwaf/workspace/customsignal/customsignal_test.go index b2eeb50f8..293df66c6 100644 --- a/pkg/commands/ngwaf/workspace/customsignal/customsignal_test.go +++ b/pkg/commands/ngwaf/workspace/customsignal/customsignal_test.go @@ -68,7 +68,7 @@ func TestCustomSignalCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(customSignal)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(customSignal))), }, }, }, @@ -194,7 +194,7 @@ func TestCustomSignalGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(customSignal)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(customSignal))), }, }, }, @@ -208,7 +208,7 @@ func TestCustomSignalGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(customSignal)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(customSignal))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/rule/rule_test.go b/pkg/commands/ngwaf/workspace/rule/rule_test.go index 281c0fdf4..5523ac805 100644 --- a/pkg/commands/ngwaf/workspace/rule/rule_test.go +++ b/pkg/commands/ngwaf/workspace/rule/rule_test.go @@ -96,7 +96,7 @@ func TestRuleCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(rule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(rule))), }, }, }, @@ -110,7 +110,7 @@ func TestRuleCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(complexRule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(complexRule))), }, }, }, @@ -236,7 +236,7 @@ func TestRuleGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(rule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(rule))), }, }, }, @@ -250,7 +250,7 @@ func TestRuleGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(rule)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(rule))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/signallist/signallist_test.go b/pkg/commands/ngwaf/workspace/signallist/signallist_test.go index e5561d365..299618bf3 100644 --- a/pkg/commands/ngwaf/workspace/signallist/signallist_test.go +++ b/pkg/commands/ngwaf/workspace/signallist/signallist_test.go @@ -98,7 +98,7 @@ func TestSignalListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -240,7 +240,7 @@ func TestSignalListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -254,7 +254,7 @@ func TestSignalListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/stringlist/stringlist_test.go b/pkg/commands/ngwaf/workspace/stringlist/stringlist_test.go index a4a35ee33..34d25812d 100644 --- a/pkg/commands/ngwaf/workspace/stringlist/stringlist_test.go +++ b/pkg/commands/ngwaf/workspace/stringlist/stringlist_test.go @@ -98,7 +98,7 @@ func TestStringListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -240,7 +240,7 @@ func TestStringListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -254,7 +254,7 @@ func TestStringListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/threshold/threshold_test.go b/pkg/commands/ngwaf/workspace/threshold/threshold_test.go index ca3b346d9..1d8e3f6e0 100644 --- a/pkg/commands/ngwaf/workspace/threshold/threshold_test.go +++ b/pkg/commands/ngwaf/workspace/threshold/threshold_test.go @@ -110,7 +110,7 @@ func TestThresholdCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(threshold)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(threshold))), }, }, }, @@ -236,7 +236,7 @@ func TestThresholdGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(threshold)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(threshold))), }, }, }, @@ -250,7 +250,7 @@ func TestThresholdGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(threshold)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(threshold))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/virtualpatch/virtualpatch_test.go b/pkg/commands/ngwaf/workspace/virtualpatch/virtualpatch_test.go index 2233a79a5..48d190e48 100644 --- a/pkg/commands/ngwaf/workspace/virtualpatch/virtualpatch_test.go +++ b/pkg/commands/ngwaf/workspace/virtualpatch/virtualpatch_test.go @@ -70,7 +70,7 @@ func TestVirtualPatchRetrieve(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(virtualpatch)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(virtualpatch))), }, }, }, @@ -84,7 +84,7 @@ func TestVirtualPatchRetrieve(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(virtualpatch)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(virtualpatch))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/wildcardlist/wildcardlist_test.go b/pkg/commands/ngwaf/workspace/wildcardlist/wildcardlist_test.go index ce4f9230d..e7ed810f7 100644 --- a/pkg/commands/ngwaf/workspace/wildcardlist/wildcardlist_test.go +++ b/pkg/commands/ngwaf/workspace/wildcardlist/wildcardlist_test.go @@ -98,7 +98,7 @@ func TestWildcardListCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -240,7 +240,7 @@ func TestWildcardListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, @@ -254,7 +254,7 @@ func TestWildcardListGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(stringlist)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(stringlist))), }, }, }, diff --git a/pkg/commands/ngwaf/workspace/workspace_test.go b/pkg/commands/ngwaf/workspace/workspace_test.go index d5a02c876..cfd7e4c01 100644 --- a/pkg/commands/ngwaf/workspace/workspace_test.go +++ b/pkg/commands/ngwaf/workspace/workspace_test.go @@ -76,7 +76,7 @@ func TestWorkspacesCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(workspace)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(workspace))), }, }, }, @@ -194,7 +194,7 @@ func TestWorkspaceGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(workspace)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(workspace))), }, }, }, @@ -208,7 +208,7 @@ func TestWorkspaceGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(workspace)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(workspace))), }, }, }, diff --git a/pkg/commands/objectstorage/accesskeys/accesskeys_test.go b/pkg/commands/objectstorage/accesskeys/accesskeys_test.go index a78b9005d..8048b373a 100644 --- a/pkg/commands/objectstorage/accesskeys/accesskeys_test.go +++ b/pkg/commands/objectstorage/accesskeys/accesskeys_test.go @@ -66,7 +66,7 @@ func TestAccessKeysCreate(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(ak)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(ak))), }, }, }, @@ -184,7 +184,7 @@ func TestAccessKeysGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(ak)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(ak))), }, }, }, @@ -198,7 +198,7 @@ func TestAccessKeysGet(t *testing.T) { Response: &http.Response{ StatusCode: http.StatusOK, Status: http.StatusText(http.StatusOK), - Body: io.NopCloser(bytes.NewReader((testutil.GenJSON(ak)))), + Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(ak))), }, }, }, diff --git a/pkg/commands/service/healthcheck/healthcheck_test.go b/pkg/commands/service/healthcheck/healthcheck_test.go index c6313713a..2d8edd29a 100644 --- a/pkg/commands/service/healthcheck/healthcheck_test.go +++ b/pkg/commands/service/healthcheck/healthcheck_test.go @@ -165,7 +165,7 @@ func TestHealthCheckUpdate(t *testing.T) { func TestHealthCheckDelete(t *testing.T) { scenarios := []testutil.CLIScenario{ { - Args: ("--service-id 123 --version 1"), + Args: "--service-id 123 --version 1", WantError: "error parsing arguments: required flag --name not provided", }, { diff --git a/pkg/global/global_test.go b/pkg/global/global_test.go index 957cc39db..c5463967e 100644 --- a/pkg/global/global_test.go +++ b/pkg/global/global_test.go @@ -36,10 +36,10 @@ func TestToken(t *testing.T) { wantToken: "stored-token-value", wantSource: lookup.SourceAuth, }, - { + { // #nosec G101 (CWE-798) name: "token flag raw value when no stored name matches", data: &global.Data{ - Flags: global.Flags{Token: "raw-api-token"}, + Flags: global.Flags{Token: "raw-api-token"}, // #nosec G101 (CWE-798) Config: config.File{ Auth: config.Auth{ Default: "user", From 3d68a67d574a3dd1bf4868facf7ab5849b3e52a2 Mon Sep 17 00:00:00 2001 From: Anthony Gomez Date: Wed, 7 Oct 2026 13:01:55 -0400 Subject: [PATCH 2/3] remove caps on issues --- .golangci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index d690b3ece..25a6aae50 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,6 +2,9 @@ version: "2" run: allow-parallel-runners: true modules-download-mode: readonly +issues: + max-issues-per-linter: 0 + max-same-issues: 0 linters: enable: - durationcheck From 81416e98ef15c69fb08b27d25aaf97ce7df08fea Mon Sep 17 00:00:00 2001 From: Anthony Gomez Date: Wed, 7 Oct 2026 13:09:06 -0400 Subject: [PATCH 3/3] bump ci lint version --- .github/workflows/pr_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index c64062f5a..37cfa39d3 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -18,7 +18,7 @@ concurrency: cancel-in-progress: true env: GO_VERSION: 1.26.x - GOLANGCI_LINT_VERSION: v2.9 + GOLANGCI_LINT_VERSION: v2.14.0 WASI_SDK_VERSION: 25 WASI_SDK_FULL_VERSION: "25.0" jobs: