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) -}