Skip to content

Commit 580a483

Browse files
committed
test : Update t.Fatalf calls to resolve stricter Go 1.24 validation
After bumping go version, I started seeing this error in tests: ``` Error: test/v200/utils/common/test_utils.go:371:12: non-constant format string in call to (*testing.common).Fatalf Error: test/v200/utils/api/test_utils.go:186:13: non-constant format string in call to (*testing.common).Fatalf ``` It seems after Go 1.24, vet is flagging this case as invalid usage. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
1 parent c66b496 commit 580a483

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/v200/utils/api/test_utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ func RunTest(testContent commonUtils.TestContent, t *testing.T) {
183183

184184
testDevfile, err := commonUtils.GetDevfile(testContent.FileName, nil, validator)
185185
if err != nil {
186-
t.Fatalf(commonUtils.LogMessage(fmt.Sprintf("Error creating devfile : %v", err)))
186+
logMsg := commonUtils.LogMessage(fmt.Sprintf("Error creating devfile: %v", err))
187+
t.Fatalf("%s", logMsg)
187188
}
188189

189190
testDevfile.RunTest(testContent, t)

test/v200/utils/common/test_utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ func (testDevfile *TestDevfile) RunTest(testContent TestContent, t *testing.T) {
368368

369369
err := testDevfile.Validator.WriteAndValidate(testDevfile)
370370
if err != nil {
371-
t.Fatalf(LogErrorMessage(fmt.Sprintf("ERROR verifying devfile : %s : %v", testContent.FileName, err)))
371+
logMsg := LogErrorMessage(fmt.Sprintf("ERROR verifying devfile: %s : %v", testContent.FileName, err))
372+
t.Fatalf("%s", logMsg)
372373
}
373374

374375
}

0 commit comments

Comments
 (0)