Harden and add gosec linter

Remediate:
G104: Errors unhandled.
G109: Potential Integer overflow made by strconv.Atoi result conversion to int16/32
G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
G304: Potential file inclusion via variable
G601: Implicit memory aliasing in for loop.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
This commit is contained in:
Manuel Rüger
2022-10-17 00:48:44 +02:00
parent d4fdcda6f5
commit 6b7027ff41
11 changed files with 70 additions and 22 deletions

View File

@@ -40,9 +40,12 @@ var (
func TestBuilderWithCustomStore(t *testing.T) {
b := builder.NewBuilder()
b.WithFamilyGeneratorFilter(generator.NewCompositeFamilyGeneratorFilter())
b.WithEnabledResources([]string{"pods"})
b.WithGenerateStoresFunc(customStore)
err := b.WithEnabledResources([]string{"pods"})
if err != nil {
t.Fatal(err)
}
b.WithGenerateStoresFunc(customStore)
var fStores []*fakeStore
for _, stores := range b.BuildStores() {
for _, store := range stores {