Skip to content

Commit ba6afc8

Browse files
committed
Fix linting issues
1 parent 4717181 commit ba6afc8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/v1/hash_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ func TestGoodHashes(t *testing.T) {
3232
for _, s := range good {
3333
h, err := NewHash(s)
3434
if err != nil {
35-
t.Errorf("Unexpected error parsing hash: %v", err)
35+
t.Error("Unexpected error parsing hash:", err)
3636
}
3737
if got, want := h.String(), s; got != want {
3838
t.Errorf("String(); got %q, want %q", got, want)
3939
}
4040
bytes, err := json.Marshal(h)
4141
if err != nil {
42-
t.Errorf("Unexpected error json.Marshaling hash: %v", err)
42+
t.Error("Unexpected error json.Marshaling hash:", err)
4343
}
4444
if got, want := string(bytes), strconv.Quote(h.String()); got != want {
4545
t.Errorf("json.Marshal(); got %q, want %q", got, want)
@@ -64,7 +64,7 @@ func TestBadHashes(t *testing.T) {
6464
for _, s := range bad {
6565
h, err := NewHash(s)
6666
if err == nil {
67-
t.Errorf("Expected error, got: %v", h)
67+
t.Error("Expected error, got:", h)
6868
}
6969
}
7070
}
@@ -73,7 +73,7 @@ func TestSHA256(t *testing.T) {
7373
input := "asdf"
7474
h, n, err := SHA256(strings.NewReader(input))
7575
if err != nil {
76-
t.Errorf("SHA256(asdf) = %v", err)
76+
t.Error("SHA256(asdf) =", err)
7777
}
7878
if got, want := h.Algorithm, "sha256"; got != want {
7979
t.Errorf("Algorithm; got %v, want %v", got, want)
@@ -92,10 +92,10 @@ func TestTextMarshalling(t *testing.T) {
9292
foo := make(map[Hash]string)
9393
b, err := json.Marshal(foo)
9494
if err != nil {
95-
t.Fatalf("could not marshal: %v", err)
95+
t.Fatal("could not marshal:", err)
9696
}
9797
if err := json.Unmarshal(b, &foo); err != nil {
98-
t.Errorf("could not unmarshal: %v", err)
98+
t.Error("could not unmarshal:", err)
9999
}
100100

101101
h := &Hash{
@@ -130,7 +130,7 @@ func TestVerificationFailure(t *testing.T) {
130130

131131
verified, err := VerifyReadCloser(ioutil.NopCloser(buf), mustHash("not the same", t))
132132
if err != nil {
133-
t.Fatalf("VerifyReadCloser() = %v", err)
133+
t.Fatal("VerifyReadCloser() =", err)
134134
}
135135
if b, err := ioutil.ReadAll(verified); err == nil {
136136
t.Errorf("ReadAll() = %q; want verification error", string(b))
@@ -143,10 +143,10 @@ func TestVerification(t *testing.T) {
143143

144144
verified, err := VerifyReadCloser(ioutil.NopCloser(buf), mustHash(want, t))
145145
if err != nil {
146-
t.Fatalf("VerifyReadCloser() = %v", err)
146+
t.Fatal("VerifyReadCloser() =", err)
147147
}
148148
if _, err := ioutil.ReadAll(verified); err != nil {
149-
t.Errorf("ReadAll() = %v", err)
149+
t.Error("ReadAll() =", err)
150150
}
151151
}
152152

0 commit comments

Comments
 (0)