Skip to content

Commit 99458ba

Browse files
committed
Add nolint comments for false positives
1 parent cda421c commit 99458ba

5 files changed

Lines changed: 6 additions & 0 deletions

File tree

internal/controller/standalone_pgadmin/users.go

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

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

4041
// The username for User in pgAdmin.

internal/patroni/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ func instanceYAML(
484484
},
485485
}
486486

487+
//nolint:gosec // G101: "pgpass" is a Patroni configuration key for a file path, not a credential.
487488
postgresql := map[string]any{
488489
// TODO(cbandy): "bin_dir"
489490

internal/postgres/parameters_test.go

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

2424
"wal_level": "logical",
2525
})
26+
//nolint:gosec // G101: "password_encryption" is a PostgreSQL parameter name, not a credential.
2627
assert.DeepEqual(t, parameters.Default.AsMap(), map[string]string{
2728
"jit": "off",
2829

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)