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

Add an option for Go build tags (#201)

* Add an option for Go build tags

* Update README with a section for Go build tags
This commit is contained in:
cosmincojocar
2018-04-20 01:45:04 +02:00
committed by Grant Murphy
parent 7790709b81
commit 4ae8c95b40
6 changed files with 60 additions and 20 deletions

View File

@@ -15,10 +15,11 @@ import (
var _ = Describe("gas rules", func() {
var (
logger *log.Logger
config gas.Config
analyzer *gas.Analyzer
runner func(string, []testutils.CodeSample)
logger *log.Logger
config gas.Config
analyzer *gas.Analyzer
runner func(string, []testutils.CodeSample)
buildTags []string
)
BeforeEach(func() {
@@ -34,7 +35,7 @@ var _ = Describe("gas rules", func() {
pkg.AddFile(fmt.Sprintf("sample_%d.go", n), sample.Code)
err := pkg.Build()
Expect(err).ShouldNot(HaveOccurred())
err = analyzer.Process(pkg.Path)
err = analyzer.Process(buildTags, pkg.Path)
Expect(err).ShouldNot(HaveOccurred())
issues, _ := analyzer.Report()
if len(issues) != sample.Errors {