diff --git a/internal/command/artifact/junit_test.go b/internal/command/artifact/junit_test.go index 5890d2e20d04..e38e92653e60 100644 --- a/internal/command/artifact/junit_test.go +++ b/internal/command/artifact/junit_test.go @@ -60,7 +60,7 @@ func TestJUnitXMLFile_save(t *testing.T) { t.Fatalf("unexpected error opening file") } - if bytes.Compare(fileContent, xml) != 0 { + if !bytes.Equal(fileContent, xml) { t.Fatalf("wanted XML:\n%s\n got XML:\n%s\n", string(xml), string(fileContent)) } }) diff --git a/internal/command/test_test.go b/internal/command/test_test.go index aa14e837b0ac..f1365c100e77 100644 --- a/internal/command/test_test.go +++ b/internal/command/test_test.go @@ -2405,7 +2405,7 @@ func TestTest_JUnitOutput(t *testing.T) { timestampRegexp := regexp.MustCompile(`timestamp="[^"]+"`) actualOut = timestampRegexp.ReplaceAll(actualOut, []byte("timestamp=\"TIMESTAMP_REDACTED\"")) - if bytes.Compare(actualOut, expectedOutput) != 0 { + if !bytes.Equal(actualOut, expectedOutput) { t.Fatalf("wanted XML:\n%s\n got XML:\n%s\n", string(expectedOutput), string(actualOut)) }