1
0
mirror of https://github.com/securego/gosec.git synced 2025-11-27 22:28:20 +02:00
Files
gosec/testutils/build_samples.go
Matthew Hartstonge 10cf58a4a4 fix: build tag parsing. (#1413)
* fix: build tag parsing.

* chore: lint fixes.
2025-11-05 10:46:27 +01:00

32 lines
559 B
Go

package testutils
import "github.com/securego/gosec/v2"
var (
// SampleCodeCompilationFail provides a file that won't compile.
SampleCodeCompilationFail = []CodeSample{
{[]string{`
package main
func main() {
fmt.Println("no package imported error")
}
`}, 1, gosec.NewConfig()},
}
// SampleCodeBuildTag provides a small program that should only compile
// provided a build tag.
SampleCodeBuildTag = []CodeSample{
{[]string{`
// +build tag
package main
import "fmt"
func main() {
fmt.Println("Hello world")
}
`}, 0, gosec.NewConfig()},
}
)