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

Add a flag which allows to scan also the tests files

Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
Cosmin Cojocar
2019-04-28 19:33:50 +02:00
committed by Cosmin Cojocar
parent f1d49a6945
commit b49c9532a8
4 changed files with 22 additions and 8 deletions

View File

@@ -25,12 +25,13 @@ var _ = Describe("gosec rules", func() {
analyzer *gosec.Analyzer
runner func(string, []testutils.CodeSample, ...option)
buildTags []string
tests bool
)
BeforeEach(func() {
logger, _ = testutils.NewLogger()
config = gosec.NewConfig()
analyzer = gosec.NewAnalyzer(config, logger)
analyzer = gosec.NewAnalyzer(config, tests, logger)
runner = func(rule string, samples []testutils.CodeSample, options ...option) {
for _, o := range options {
config.SetGlobal(o.name, o.value)