From d1303fee0b9617db616008bd3fcd0944caf39f29 Mon Sep 17 00:00:00 2001 From: Grant Murphy Date: Wed, 11 Jan 2017 10:12:11 -0800 Subject: [PATCH] Improve specitivity of error message for GenDecl --- rules/hardcoded_credentials.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/hardcoded_credentials.go b/rules/hardcoded_credentials.go index 6d19fa0..1a46ba5 100644 --- a/rules/hardcoded_credentials.go +++ b/rules/hardcoded_credentials.go @@ -64,7 +64,7 @@ func (r *Credentials) matchGenDecl(decl *ast.GenDecl, ctx *gas.Context) (*gas.Is index = len(valueSpec.Values) - 1 } if rhs, ok := valueSpec.Values[index].(*ast.BasicLit); ok && rhs.Kind == token.STRING { - return gas.NewIssue(ctx, decl, r.What, r.Severity, r.Confidence), nil + return gas.NewIssue(ctx, valueSpec, r.What, r.Severity, r.Confidence), nil } } }