mirror of
https://github.com/securego/gosec.git
synced 2024-12-26 20:53:56 +02:00
Fix formatting
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
parent
3e69a8c8a2
commit
b68ac76dbc
@ -224,7 +224,7 @@ func (gosec *Analyzer) ParseErrors(pkg *packages.Package) error {
|
|||||||
|
|
||||||
// AppendError appends an error to the file errors
|
// AppendError appends an error to the file errors
|
||||||
func (gosec *Analyzer) AppendError(file string, err error) {
|
func (gosec *Analyzer) AppendError(file string, err error) {
|
||||||
// Do not report the error for empty packages (e.g. files excluded from build with a tag
|
// Do not report the error for empty packages (e.g. files excluded from build with a tag)
|
||||||
r := regexp.MustCompile(`no buildable Go source files in`)
|
r := regexp.MustCompile(`no buildable Go source files in`)
|
||||||
if r.MatchString(err.Error()) {
|
if r.MatchString(err.Error()) {
|
||||||
return
|
return
|
||||||
|
@ -231,7 +231,7 @@ var _ = Describe("Analyzer", func() {
|
|||||||
pkg := testutils.NewTestPackage()
|
pkg := testutils.NewTestPackage()
|
||||||
defer pkg.Close()
|
defer pkg.Close()
|
||||||
pkg.AddFile("foo_test.go", `
|
pkg.AddFile("foo_test.go", `
|
||||||
package tests
|
package tests
|
||||||
import "testing"
|
import "testing"
|
||||||
func TestFoo(t *testing.T){
|
func TestFoo(t *testing.T){
|
||||||
}`)
|
}`)
|
||||||
@ -271,14 +271,14 @@ var _ = Describe("Analyzer", func() {
|
|||||||
pkg := testutils.NewTestPackage()
|
pkg := testutils.NewTestPackage()
|
||||||
defer pkg.Close()
|
defer pkg.Close()
|
||||||
pkg.AddFile("foo.go", `
|
pkg.AddFile("foo.go", `
|
||||||
package foo
|
package foo
|
||||||
func foo(){
|
func foo(){
|
||||||
}`)
|
}`)
|
||||||
pkg.AddFile("foo_test.go", `
|
pkg.AddFile("foo_test.go", `
|
||||||
package foo_test
|
package foo_test
|
||||||
import "testing"
|
import "testing"
|
||||||
func TestFoo(t *testing.T){
|
func TestFoo(t *testing.T){
|
||||||
}`)
|
}`)
|
||||||
err := pkg.Build()
|
err := pkg.Build()
|
||||||
Expect(err).ShouldNot(HaveOccurred())
|
Expect(err).ShouldNot(HaveOccurred())
|
||||||
err = customAnalyzer.Process(buildTags, pkg.Path)
|
err = customAnalyzer.Process(buildTags, pkg.Path)
|
||||||
|
Loading…
Reference in New Issue
Block a user