Skip to content

Commit 281306c

Browse files
committed
Fix linter
1 parent dea6414 commit 281306c

26 files changed

+30
-30
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: lint
2020
uses: golangci/[email protected]
2121
with:
22-
version: v1.54.2
22+
version: v1.60
2323

2424
tests-on-unix:
2525
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors

atmcfg/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package atmcfg
1616

1717
import (
18-
"crypto/sha1" //nolint:gosec // mongodb scram-sha-1 supports this tho is not recommended
18+
"crypto/sha1" // #nosec G101 // #nosec G505 // mongodb scram-sha-1 supports this tho is not recommended
1919
"crypto/sha256"
2020
"encoding/base64"
2121
"errors"

atmcfg/security.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package atmcfg
1616

1717
import (
1818
"crypto/hmac"
19-
"crypto/md5" //nolint:gosec // used as part of the sha1 standard
19+
"crypto/md5" // #nosec G101 // #nosec G501 // used as part of the sha1 standard
2020
"encoding/base64"
2121
"encoding/hex"
2222
"fmt"
@@ -165,7 +165,7 @@ func generateSalt(hashConstructor func() hash.Hash) ([]byte, error) {
165165
}
166166

167167
func md5Hex(s string) (string, error) {
168-
h := md5.New() //nolint:gosec // used as part of the sha1 standard
168+
h := md5.New() // #nosec G101 // #nosec G401 // used as part of the sha1 standard
169169

170170
if _, err := h.Write([]byte(s)); err != nil {
171171
return "", err

atmcfg/security_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package atmcfg
1616

1717
import (
18-
"crypto/sha1" //nolint:gosec // used as part of the sha1 standard
18+
"crypto/sha1" // #nosec G101 // #nosec G505 // used as part of the sha1 standard
1919
"testing"
2020

2121
"github.com/stretchr/testify/assert"

auth/device_flow_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func TestConfig_RevokeToken(t *testing.T) {
173173
config, mux, teardown := setup()
174174
defer teardown()
175175

176-
mux.HandleFunc("/api/private/unauth/account/device/revoke", func(w http.ResponseWriter, r *http.Request) {
176+
mux.HandleFunc("/api/private/unauth/account/device/revoke", func(_ http.ResponseWriter, r *http.Request) {
177177
testMethod(t, r)
178178
})
179179

opsmngr/accesslist_api_keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"net/http"
2121
)
2222

23-
const accessListAPIKeysPath = "api/public/v1.0/orgs/%s/apiKeys/%s/accessList" //nolint:gosec // This is a path
23+
const accessListAPIKeysPath = "api/public/v1.0/orgs/%s/apiKeys/%s/accessList" // #nosec G101 // This is a path
2424

2525
// AccessListAPIKeysService is an interface for interfacing with the AccessList API Keys
2626
// endpoints of the MongoDB Ops Manager API.

opsmngr/accesslist_api_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
const (
27-
apiKeyID = "API-KEY-ID" //nolint:gosec // ID and not an actual key
27+
apiKeyID = "API-KEY-ID" // #nosec G101 // ID and not an actual key
2828
ipAddress = "IP-ADDRESS"
2929
)
3030

opsmngr/agents_api_keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
)
2222

2323
const (
24-
agentAPIKeysBasePath = "api/public/v1.0/groups/%s/agentapikeys" //nolint:gosec // This is a path
24+
agentAPIKeysBasePath = "api/public/v1.0/groups/%s/agentapikeys" // #nosec G101 // This is a path
2525
)
2626

2727
// AgentAPIKey defines the structure for an Agent API key.

opsmngr/agents_api_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/go-test/deep"
2323
)
2424

25-
const projectID = "5e66185d917b220fbd8bb4d1" //nolint:gosec // not a credential
25+
const projectID = "5e66185d917b220fbd8bb4d1" // not a credential
2626

2727
func TestAgentsServiceOp_ListAgentAPIKeys(t *testing.T) {
2828
client, mux, teardown := setup()

opsmngr/alert_configurations_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/go-test/deep"
2424
)
2525

26-
const alertConfigID = "57b76ddc96e8215c017ceafb" //nolint:gosec // not a credential
26+
const alertConfigID = "57b76ddc96e8215c017ceafb" // #nosec G101 // not a credential
2727

2828
func TestAlertConfiguration_Create(t *testing.T) {
2929
client, mux, teardown := setup()

0 commit comments

Comments
 (0)