Adding gosec and lint, fixing null_type overflow
ChangeLog: - Adding gosec linting - Adding static type to enum - fixing nulltype overflow - Trying out gotestsum as an alternative to go-junit-report.xml
This commit is contained in:
parent
f9358ca8d2
commit
f7082eda68
16 changed files with 193 additions and 93 deletions
|
|
@ -10,7 +10,7 @@ import (
|
|||
// Exists expects file to exist on path constructed from pathElems and returns content of the file
|
||||
func Exists(t *testing.T, pathElems ...string) (fileContent string) {
|
||||
modelFilePath := path.Join(pathElems...)
|
||||
file, err := os.ReadFile(modelFilePath)
|
||||
file, err := os.ReadFile(modelFilePath) // #nosec G304
|
||||
require.Nil(t, err)
|
||||
require.NotEmpty(t, file)
|
||||
return string(file)
|
||||
|
|
@ -19,6 +19,6 @@ func Exists(t *testing.T, pathElems ...string) (fileContent string) {
|
|||
// NotExists expects file not to exist on path constructed from pathElems
|
||||
func NotExists(t *testing.T, pathElems ...string) {
|
||||
modelFilePath := path.Join(pathElems...)
|
||||
_, err := os.ReadFile(modelFilePath)
|
||||
_, err := os.ReadFile(modelFilePath) // #nosec G304
|
||||
require.True(t, os.IsNotExist(err))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue