From 2e7f3a4410212f0d99b943883cb719d10dd32abe Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Wed, 10 Nov 2021 13:17:51 +1100 Subject: [PATCH] Include secure as part of build process --- scripts/devtools.sh | 2 +- test/utils.go | 22 ---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/scripts/devtools.sh b/scripts/devtools.sh index aa4b80e7..c418beec 100755 --- a/scripts/devtools.sh +++ b/scripts/devtools.sh @@ -2,4 +2,4 @@ set -ex go get golang.org/x/tools/cmd/goimports wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.37.1 -# wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.8.1 +wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.9.1 diff --git a/test/utils.go b/test/utils.go index ab03776a..8b0d9cd4 100644 --- a/test/utils.go +++ b/test/utils.go @@ -3,7 +3,6 @@ package test import ( "bytes" "fmt" - "io/ioutil" "os" "reflect" "strings" @@ -69,24 +68,3 @@ func AssertResultWithContext(t *testing.T, expectedValue interface{}, actualValu t.Error(": expected <", expectedValue, "> but got <", actualValue, ">") } } - -func WriteTempYamlFile(content string) string { - tmpfile, _ := ioutil.TempFile("", "testyaml") - defer func() { - _ = tmpfile.Close() - }() - - _, _ = tmpfile.Write([]byte(content)) - return tmpfile.Name() -} - -func ReadTempYamlFile(name string) string { - // ignore CWE-22 gosec issue - that's more targetted for http based apps that run in a public directory, - // and ensuring that it's not possible to give a path to a file outside thar directory. - content, _ := ioutil.ReadFile(name) // #nosec - return string(content) -} - -func RemoveTempYamlFile(name string) { - _ = os.Remove(name) -}