Skip to content

Commit bd9f4c7

Browse files
committed
Add nolint comments for false positives
1 parent 3a02d3f commit bd9f4c7

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

internal/controller/standalone_pgadmin/users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type pgAdminUserForJson struct {
3636
IsAdmin bool `json:"isAdmin"`
3737

3838
// The user's password
39+
//nolint:gosec // G117: This is a JSON serialization struct, not a hardcoded credential.
3940
Password string `json:"password"`
4041

4142
// The username for User in pgAdmin.

internal/patroni/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ func instanceYAML(
474474
},
475475
}
476476

477+
//nolint:gosec // G101: "pgpass" is a Patroni configuration key for a file path, not a credential.
477478
postgresql := map[string]any{
478479
// Missing here is "connect_address" which cannot be known until the
479480
// instance Pod is created. That value should be injected using the downward

internal/postgres/parameters_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func TestNewParameters(t *testing.T) {
2525

2626
"wal_level": "logical",
2727
})
28+
//nolint:gosec // G101: "password_encryption" is a PostgreSQL parameter name, not a credential.
2829
assert.DeepEqual(t, parameters.Default.AsMap(), map[string]string{
2930
"jit": "off",
3031

internal/postgres/password/scram_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ func TestSCRAMSASLPrep(t *testing.T) {
190190
tests := []stringStruct{
191191
{password: "hippo", expected: "hippo"},
192192
{password: "híppo", expected: "híppo"},
193+
//nolint:gosec // G101: Test data for password normalization, not a credential.
193194
{password: "こんにちは", expected: "こんにちは"},
194195
{password: "hippo\u1680lake", expected: "hippo lake"},
195196
{password: "hipp\ufe01o", expected: "hippo"},

internal/util/secrets_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestAccumulate(t *testing.T) {
2020
called := 0
2121
result, err := accumulate(10, func() (byte, error) {
2222
called++
23+
//nolint:gosec // G115: called is bounded by test iteration count, no overflow possible.
2324
return byte('A' + called), nil
2425
})
2526

@@ -33,6 +34,7 @@ func TestAccumulate(t *testing.T) {
3334
result, err := accumulate(10, func() (byte, error) {
3435
called++
3536
if called < 5 {
37+
//nolint:gosec // G115: called is bounded by test iteration count, no overflow possible.
3638
return byte('A' + called), nil
3739
} else {
3840
return 'Z', expected

0 commit comments

Comments
 (0)