Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

Commit 34bad6f

Browse files
Merge pull request #942 from keep-network/gosec-env-var
Fix ignore comment for PasswordEnvVariable gosec gosec command doesn't ignore the line if // #nosec is not in the first comment line. So what would work is: ``` // #nosec G101 (look for hardcoded credentials) // This line doesn't contain any credentials. // It's just the name of the environment variable. // PasswordEnvVariable environment variable name for ethereum key password. const PasswordEnvVariable = "KEEP_ETHEREUM_PASSWORD" ``` But this makes go lint fail with exported const PasswordEnvVariable should have a comment or be unexported. The solution in this PR makes both golint and gosec work.
2 parents 2c34c95 + 847157a commit 34bad6f

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

config/config.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ import (
1515
)
1616

1717
// PasswordEnvVariable environment variable name for ethereum key password.
18-
// #nosec G101 (look for hardcoded credentials)
19-
// This line doesn't contain any credentials.
20-
// It's just the name of the environment variable.
21-
const PasswordEnvVariable = "KEEP_ETHEREUM_PASSWORD"
18+
const PasswordEnvVariable = "KEEP_ETHEREUM_PASSWORD" // #nosec G101 -- it's just env variable name
2219

2320
// Config is the top level config structure.
2421
type Config struct {

0 commit comments

Comments
 (0)