mirror of
https://github.com/securego/gosec.git
synced 2025-11-23 22:15:04 +02:00
Report for Golang errors (#284)
* Report for Golang errors Right now if you use Gosec to scan invalid go file and if you report the result in a text, JSON, CSV or another file format you will always receive 0 issues. The reason for that is that Gosec can't parse the AST of invalid go files and thus will not report anything. The real problem here is that the user will never know about the issue if he generates the output in a file. Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
This commit is contained in:
committed by
Grant Murphy
parent
9cdfec40ca
commit
62b5195dd9
@@ -47,7 +47,7 @@ var _ = Describe("gosec rules", func() {
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
err = analyzer.Process(buildTags, pkg.Path)
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
issues, _ := analyzer.Report()
|
||||
issues, _, _ := analyzer.Report()
|
||||
if len(issues) != sample.Errors {
|
||||
fmt.Println(sample.Code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user