1
0
mirror of https://github.com/securego/gosec.git synced 2025-11-25 22:22:17 +02:00

Fix use rule IDs to retrieve the rule config

This commit is contained in:
robot-5
2022-03-28 21:28:02 +03:00
committed by GitHub
parent 82eaa12696
commit afc9903ba9
4 changed files with 6 additions and 6 deletions

View File

@@ -122,7 +122,7 @@ func NewHardcodedCredentials(id string, conf gosec.Config) (gosec.Rule, []ast.No
perCharThreshold := 3.0
ignoreEntropy := false
truncateString := 16
if val, ok := conf["G101"]; ok {
if val, ok := conf[id]; ok {
conf := val.(map[string]interface{})
if configPattern, ok := conf["pattern"]; ok {
if cfgPattern, ok := configPattern.(string); ok {