mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
Merge pull request #110 from GoASTScanner/bugfix
Improve specitivity of error message for GenDecl
This commit is contained in:
commit
bc21a39c66
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ func (r *Credentials) matchGenDecl(decl *ast.GenDecl, ctx *gas.Context) (*gas.Is
|
||||||
index = len(valueSpec.Values) - 1
|
index = len(valueSpec.Values) - 1
|
||||||
}
|
}
|
||||||
if rhs, ok := valueSpec.Values[index].(*ast.BasicLit); ok && rhs.Kind == token.STRING {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue