]> Cypherpunks repositories - gostls13.git/commitdiff
all: fix some vet-found printf errors
authorRob Pike <r@golang.org>
Mon, 25 Feb 2013 20:43:03 +0000 (12:43 -0800)
committerRob Pike <r@golang.org>
Mon, 25 Feb 2013 20:43:03 +0000 (12:43 -0800)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7393059

src/pkg/archive/tar/reader_test.go
src/pkg/encoding/gob/gobencdec_test.go
src/pkg/encoding/json/decode_test.go
src/pkg/net/http/request_test.go

index 12bfeff36bd9badd40368e36d71a2545eefb4538..9a1968237138c2c974fd01e19e64cc801daef835 100644 (file)
@@ -338,7 +338,7 @@ func TestParsePAXTime(t *testing.T) {
                        t.Fatal(err)
                }
                if !ts.Equal(expected) {
-                       t.Fatal("Time parsing failure %s %s", ts, expected)
+                       t.Fatalf("Time parsing failure %s %s", ts, expected)
                }
        }
 }
index 18f4450da6d4051a322cceabc2c98edda4941ecc..8f54e37994b1b1a92c1a5af6dc60884bb7eba635 100644 (file)
@@ -348,7 +348,7 @@ func TestGobEncoderFieldsOfDifferentType(t *testing.T) {
                t.Fatal("decode error:", err)
        }
        if y.G.s != "XYZ" {
-               t.Fatalf("expected `XYZ` got %c", y.G.s)
+               t.Fatalf("expected `XYZ` got %q", y.G.s)
        }
 }
 
index 1ce26f8fb300161cc63f71f67b1b4743b49a6f2d..e1bd918dda596b4643d11e5c7f8c775600ea5258 100644 (file)
@@ -1158,7 +1158,7 @@ type Time3339 time.Time
 
 func (t *Time3339) UnmarshalJSON(b []byte) error {
        if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' {
-               return fmt.Errorf("types: failed to unmarshal non-string value %q as an RFC 3339 time")
+               return fmt.Errorf("types: failed to unmarshal non-string value %q as an RFC 3339 time", b)
        }
        tm, err := time.Parse(time.RFC3339, string(b[1:len(b)-1]))
        if err != nil {
index 0e7bda1b952362d6845bf9e11bdeae7cba122716..00ad791dedbd08ab3d331f31f7260711e6ca6326 100644 (file)
@@ -262,7 +262,7 @@ func TestNewRequestContentLength(t *testing.T) {
                        t.Fatal(err)
                }
                if req.ContentLength != tt.want {
-                       t.Errorf("ContentLength(%#T) = %d; want %d", tt.r, req.ContentLength, tt.want)
+                       t.Errorf("ContentLength(%T) = %d; want %d", tt.r, req.ContentLength, tt.want)
                }
        }
 }