diff --git a/pkg/v1/hash_test.go b/pkg/v1/hash_test.go index bf06e03aba..650d053373 100644 --- a/pkg/v1/hash_test.go +++ b/pkg/v1/hash_test.go @@ -32,14 +32,14 @@ func TestGoodHashes(t *testing.T) { for _, s := range good { h, err := NewHash(s) if err != nil { - t.Errorf("Unexpected error parsing hash: %v", err) + t.Error("Unexpected error parsing hash:", err) } if got, want := h.String(), s; got != want { t.Errorf("String(); got %q, want %q", got, want) } bytes, err := json.Marshal(h) if err != nil { - t.Errorf("Unexpected error json.Marshaling hash: %v", err) + t.Error("Unexpected error json.Marshaling hash:", err) } if got, want := string(bytes), strconv.Quote(h.String()); got != want { t.Errorf("json.Marshal(); got %q, want %q", got, want) @@ -64,7 +64,7 @@ func TestBadHashes(t *testing.T) { for _, s := range bad { h, err := NewHash(s) if err == nil { - t.Errorf("Expected error, got: %v", h) + t.Error("Expected error, got:", h) } } } @@ -73,7 +73,7 @@ func TestSHA256(t *testing.T) { input := "asdf" h, n, err := SHA256(strings.NewReader(input)) if err != nil { - t.Errorf("SHA256(asdf) = %v", err) + t.Error("SHA256(asdf) =", err) } if got, want := h.Algorithm, "sha256"; got != want { t.Errorf("Algorithm; got %v, want %v", got, want) @@ -92,10 +92,10 @@ func TestTextMarshalling(t *testing.T) { foo := make(map[Hash]string) b, err := json.Marshal(foo) if err != nil { - t.Fatalf("could not marshal: %v", err) + t.Fatal("could not marshal:", err) } if err := json.Unmarshal(b, &foo); err != nil { - t.Errorf("could not unmarshal: %v", err) + t.Error("could not unmarshal:", err) } h := &Hash{ @@ -119,7 +119,7 @@ func TestTextMarshalling(t *testing.T) { func mustHash(s string, t *testing.T) Hash { h, _, err := SHA256(strings.NewReader(s)) if err != nil { - t.Fatalf("SHA256(%s) = %v", s, err) + t.Fatal("SHA256(%s) =", s, err) } return h } @@ -130,7 +130,7 @@ func TestVerificationFailure(t *testing.T) { verified, err := VerifyReadCloser(ioutil.NopCloser(buf), mustHash("not the same", t)) if err != nil { - t.Fatalf("VerifyReadCloser() = %v", err) + t.Fatal("VerifyReadCloser() =", err) } if b, err := ioutil.ReadAll(verified); err == nil { t.Errorf("ReadAll() = %q; want verification error", string(b)) @@ -143,10 +143,10 @@ func TestVerification(t *testing.T) { verified, err := VerifyReadCloser(ioutil.NopCloser(buf), mustHash(want, t)) if err != nil { - t.Fatalf("VerifyReadCloser() = %v", err) + t.Fatal("VerifyReadCloser() =", err) } if _, err := ioutil.ReadAll(verified); err != nil { - t.Errorf("ReadAll() = %v", err) + t.Error("ReadAll() =", err) } }