This repository was archived by the owner on May 22, 2023. It is now read-only.
Commit 34bad6f
authored
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.1 file changed
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 18 | + | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
| |||
0 commit comments