throughout: fix broken calls to Printf etc.
I have written a tool to verify Printf calls, and although it's not
ready to be reviewed yet it's already uncovered a spate of problems
in the repository.  I'm sending this CL to break the changes into
pieces; as the tool improves it will find more, I'm sure.

R=rsc
CC=golang-dev
https://golang.org/cl/3427043
diff --git a/src/pkg/archive/zip/reader_test.go b/src/pkg/archive/zip/reader_test.go
index 8e1fbbf..3c24f14 100644
--- a/src/pkg/archive/zip/reader_test.go
+++ b/src/pkg/archive/zip/reader_test.go
@@ -111,7 +111,7 @@
 	var b bytes.Buffer
 	_, err = io.Copy(&b, r)
 	if err != ChecksumError {
-		t.Errorf("%s: copy error=%v, want %v", err, ChecksumError)
+		t.Errorf("%s: copy error=%v, want %v", z.File[0].Name, err, ChecksumError)
 	}
 }
 
@@ -144,7 +144,7 @@
 	}
 	for i, b := range b.Bytes() {
 		if b != c[i] {
-			t.Errorf("%s: content[%d]=%q want %q", i, b, c[i])
+			t.Errorf("%s: content[%d]=%q want %q", f.Name, i, b, c[i])
 			return
 		}
 	}
diff --git a/src/pkg/big/int_test.go b/src/pkg/big/int_test.go
index 818d0c6..fc981e1 100755
--- a/src/pkg/big/int_test.go
+++ b/src/pkg/big/int_test.go
@@ -94,7 +94,7 @@
 	var z Int
 	f(&z, a.x, a.y)
 	if !isNormalized(&z) {
-		t.Errorf("msg: %v is not normalized", z, msg)
+		t.Errorf("%s%v is not normalized", z, msg)
 	}
 	if (&z).Cmp(a.z) != 0 {
 		t.Errorf("%s%+v\n\tgot z = %v; want %v", msg, a, &z, a.z)
diff --git a/src/pkg/bufio/bufio_test.go b/src/pkg/bufio/bufio_test.go
index d84d187..059ca6d 100644
--- a/src/pkg/bufio/bufio_test.go
+++ b/src/pkg/bufio/bufio_test.go
@@ -397,9 +397,9 @@
 			}
 			for l := 0; l < len(written); l++ {
 				if written[i] != data[i] {
-					t.Errorf("%s: wrong bytes written")
-					t.Errorf("want=%s", data[0:len(written)])
-					t.Errorf("have=%s", written)
+					t.Errorf("wrong bytes written")
+					t.Errorf("want=%q", data[0:len(written)])
+					t.Errorf("have=%q", written)
 				}
 			}
 		}
diff --git a/src/pkg/bytes/buffer_test.go b/src/pkg/bytes/buffer_test.go
index ef42d43..509793d 100644
--- a/src/pkg/bytes/buffer_test.go
+++ b/src/pkg/bytes/buffer_test.go
@@ -165,7 +165,7 @@
 			t.Error("ReadByte unexpected eof")
 		}
 		if c != data[1] {
-			t.Error("ReadByte wrong value c=%v", c)
+			t.Errorf("ReadByte wrong value c=%v", c)
 		}
 		c, err = buf.ReadByte()
 		if err == nil {
diff --git a/src/pkg/container/vector/intvector_test.go b/src/pkg/container/vector/intvector_test.go
index fcc7403..1e38a19 100644
--- a/src/pkg/container/vector/intvector_test.go
+++ b/src/pkg/container/vector/intvector_test.go
@@ -127,59 +127,59 @@
 
 	for i := 0; i < n; i++ {
 		if a.Len() != i {
-			t.Errorf("T%: A) wrong Len() %d (expected %d)", a, a.Len(), i)
+			t.Errorf("%T: A) wrong Len() %d (expected %d)", a, a.Len(), i)
 		}
 		if len(a) != i {
-			t.Errorf("T%: A) wrong len() %d (expected %d)", a, len(a), i)
+			t.Errorf("%T: A) wrong len() %d (expected %d)", a, len(a), i)
 		}
 		a.Insert(0, int2IntValue(val(i)))
 		if elem2IntValue(a.Last()) != int2IntValue(val(0)) {
-			t.Error("T%: B", a)
+			t.Errorf("%T: B", a)
 		}
 	}
 	for i := n - 1; i >= 0; i-- {
 		if elem2IntValue(a.Last()) != int2IntValue(val(0)) {
-			t.Error("T%: C", a)
+			t.Errorf("%T: C", a)
 		}
 		if elem2IntValue(a.At(0)) != int2IntValue(val(i)) {
-			t.Error("T%: D", a)
+			t.Errorf("%T: D", a)
 		}
 		if elem2IntValue(a[0]) != int2IntValue(val(i)) {
-			t.Error("T%: D2", a)
+			t.Errorf("%T: D2", a)
 		}
 		a.Delete(0)
 		if a.Len() != i {
-			t.Errorf("T%: E) wrong Len() %d (expected %d)", a, a.Len(), i)
+			t.Errorf("%T: E) wrong Len() %d (expected %d)", a, a.Len(), i)
 		}
 		if len(a) != i {
-			t.Errorf("T%: E) wrong len() %d (expected %d)", a, len(a), i)
+			t.Errorf("%T: E) wrong len() %d (expected %d)", a, len(a), i)
 		}
 	}
 
 	if a.Len() != 0 {
-		t.Errorf("T%: F) wrong Len() %d (expected 0)", a, a.Len())
+		t.Errorf("%T: F) wrong Len() %d (expected 0)", a, a.Len())
 	}
 	if len(a) != 0 {
-		t.Errorf("T%: F) wrong len() %d (expected 0)", a, len(a))
+		t.Errorf("%T: F) wrong len() %d (expected 0)", a, len(a))
 	}
 	for i := 0; i < n; i++ {
 		a.Push(int2IntValue(val(i)))
 		if a.Len() != i+1 {
-			t.Errorf("T%: G) wrong Len() %d (expected %d)", a, a.Len(), i+1)
+			t.Errorf("%T: G) wrong Len() %d (expected %d)", a, a.Len(), i+1)
 		}
 		if len(a) != i+1 {
-			t.Errorf("T%: G) wrong len() %d (expected %d)", a, len(a), i+1)
+			t.Errorf("%T: G) wrong len() %d (expected %d)", a, len(a), i+1)
 		}
 		if elem2IntValue(a.Last()) != int2IntValue(val(i)) {
-			t.Error("T%: H", a)
+			t.Errorf("%T: H", a)
 		}
 	}
 	a.Resize(0, 0)
 	if a.Len() != 0 {
-		t.Errorf("T%: I wrong Len() %d (expected 0)", a, a.Len())
+		t.Errorf("%T: I wrong Len() %d (expected 0)", a, a.Len())
 	}
 	if len(a) != 0 {
-		t.Errorf("T%: I wrong len() %d (expected 0)", a, len(a))
+		t.Errorf("%T: I wrong len() %d (expected 0)", a, len(a))
 	}
 
 	const m = 5
@@ -189,21 +189,21 @@
 			x := val(i)
 			a.Push(int2IntValue(x))
 			if elem2IntValue(a.Pop()) != int2IntValue(x) {
-				t.Error("T%: J", a)
+				t.Errorf("%T: J", a)
 			}
 			if a.Len() != j+1 {
-				t.Errorf("T%: K) wrong Len() %d (expected %d)", a, a.Len(), j+1)
+				t.Errorf("%T: K) wrong Len() %d (expected %d)", a, a.Len(), j+1)
 			}
 			if len(a) != j+1 {
-				t.Errorf("T%: K) wrong len() %d (expected %d)", a, len(a), j+1)
+				t.Errorf("%T: K) wrong len() %d (expected %d)", a, len(a), j+1)
 			}
 		}
 	}
 	if a.Len() != m {
-		t.Errorf("T%: L) wrong Len() %d (expected %d)", a, a.Len(), m)
+		t.Errorf("%T: L) wrong Len() %d (expected %d)", a, a.Len(), m)
 	}
 	if len(a) != m {
-		t.Errorf("T%: L) wrong len() %d (expected %d)", a, len(a), m)
+		t.Errorf("%T: L) wrong len() %d (expected %d)", a, len(a), m)
 	}
 }
 
@@ -211,14 +211,14 @@
 func verify_sliceInt(t *testing.T, x *IntVector, elt, i, j int) {
 	for k := i; k < j; k++ {
 		if elem2IntValue(x.At(k)) != int2IntValue(elt) {
-			t.Errorf("T%: M) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt))
+			t.Errorf("%T: M) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt))
 		}
 	}
 
 	s := x.Slice(i, j)
 	for k, n := 0, j-i; k < n; k++ {
 		if elem2IntValue(s.At(k)) != int2IntValue(elt) {
-			t.Errorf("T%: N) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt))
+			t.Errorf("%T: N) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt))
 		}
 	}
 }
@@ -227,10 +227,10 @@
 func verify_patternInt(t *testing.T, x *IntVector, a, b, c int) {
 	n := a + b + c
 	if x.Len() != n {
-		t.Errorf("T%: O) wrong Len() %d (expected %d)", x, x.Len(), n)
+		t.Errorf("%T: O) wrong Len() %d (expected %d)", x, x.Len(), n)
 	}
 	if len(*x) != n {
-		t.Errorf("T%: O) wrong len() %d (expected %d)", x, len(*x), n)
+		t.Errorf("%T: O) wrong len() %d (expected %d)", x, len(*x), n)
 	}
 	verify_sliceInt(t, x, 0, 0, a)
 	verify_sliceInt(t, x, 1, a, a+b)
diff --git a/src/pkg/container/vector/stringvector_test.go b/src/pkg/container/vector/stringvector_test.go
index 2f3f082..776ae26 100644
--- a/src/pkg/container/vector/stringvector_test.go
+++ b/src/pkg/container/vector/stringvector_test.go
@@ -127,59 +127,59 @@
 
 	for i := 0; i < n; i++ {
 		if a.Len() != i {
-			t.Errorf("T%: A) wrong Len() %d (expected %d)", a, a.Len(), i)
+			t.Errorf("%T: A) wrong Len() %d (expected %d)", a, a.Len(), i)
 		}
 		if len(a) != i {
-			t.Errorf("T%: A) wrong len() %d (expected %d)", a, len(a), i)
+			t.Errorf("%T: A) wrong len() %d (expected %d)", a, len(a), i)
 		}
 		a.Insert(0, int2StrValue(val(i)))
 		if elem2StrValue(a.Last()) != int2StrValue(val(0)) {
-			t.Error("T%: B", a)
+			t.Errorf("%T: B", a)
 		}
 	}
 	for i := n - 1; i >= 0; i-- {
 		if elem2StrValue(a.Last()) != int2StrValue(val(0)) {
-			t.Error("T%: C", a)
+			t.Errorf("%T: C", a)
 		}
 		if elem2StrValue(a.At(0)) != int2StrValue(val(i)) {
-			t.Error("T%: D", a)
+			t.Errorf("%T: D", a)
 		}
 		if elem2StrValue(a[0]) != int2StrValue(val(i)) {
-			t.Error("T%: D2", a)
+			t.Errorf("%T: D2", a)
 		}
 		a.Delete(0)
 		if a.Len() != i {
-			t.Errorf("T%: E) wrong Len() %d (expected %d)", a, a.Len(), i)
+			t.Errorf("%T: E) wrong Len() %d (expected %d)", a, a.Len(), i)
 		}
 		if len(a) != i {
-			t.Errorf("T%: E) wrong len() %d (expected %d)", a, len(a), i)
+			t.Errorf("%T: E) wrong len() %d (expected %d)", a, len(a), i)
 		}
 	}
 
 	if a.Len() != 0 {
-		t.Errorf("T%: F) wrong Len() %d (expected 0)", a, a.Len())
+		t.Errorf("%T: F) wrong Len() %d (expected 0)", a, a.Len())
 	}
 	if len(a) != 0 {
-		t.Errorf("T%: F) wrong len() %d (expected 0)", a, len(a))
+		t.Errorf("%T: F) wrong len() %d (expected 0)", a, len(a))
 	}
 	for i := 0; i < n; i++ {
 		a.Push(int2StrValue(val(i)))
 		if a.Len() != i+1 {
-			t.Errorf("T%: G) wrong Len() %d (expected %d)", a, a.Len(), i+1)
+			t.Errorf("%T: G) wrong Len() %d (expected %d)", a, a.Len(), i+1)
 		}
 		if len(a) != i+1 {
-			t.Errorf("T%: G) wrong len() %d (expected %d)", a, len(a), i+1)
+			t.Errorf("%T: G) wrong len() %d (expected %d)", a, len(a), i+1)
 		}
 		if elem2StrValue(a.Last()) != int2StrValue(val(i)) {
-			t.Error("T%: H", a)
+			t.Errorf("%T: H", a)
 		}
 	}
 	a.Resize(0, 0)
 	if a.Len() != 0 {
-		t.Errorf("T%: I wrong Len() %d (expected 0)", a, a.Len())
+		t.Errorf("%T: I wrong Len() %d (expected 0)", a, a.Len())
 	}
 	if len(a) != 0 {
-		t.Errorf("T%: I wrong len() %d (expected 0)", a, len(a))
+		t.Errorf("%T: I wrong len() %d (expected 0)", a, len(a))
 	}
 
 	const m = 5
@@ -189,21 +189,21 @@
 			x := val(i)
 			a.Push(int2StrValue(x))
 			if elem2StrValue(a.Pop()) != int2StrValue(x) {
-				t.Error("T%: J", a)
+				t.Errorf("%T: J", a)
 			}
 			if a.Len() != j+1 {
-				t.Errorf("T%: K) wrong Len() %d (expected %d)", a, a.Len(), j+1)
+				t.Errorf("%T: K) wrong Len() %d (expected %d)", a, a.Len(), j+1)
 			}
 			if len(a) != j+1 {
-				t.Errorf("T%: K) wrong len() %d (expected %d)", a, len(a), j+1)
+				t.Errorf("%T: K) wrong len() %d (expected %d)", a, len(a), j+1)
 			}
 		}
 	}
 	if a.Len() != m {
-		t.Errorf("T%: L) wrong Len() %d (expected %d)", a, a.Len(), m)
+		t.Errorf("%T: L) wrong Len() %d (expected %d)", a, a.Len(), m)
 	}
 	if len(a) != m {
-		t.Errorf("T%: L) wrong len() %d (expected %d)", a, len(a), m)
+		t.Errorf("%T: L) wrong len() %d (expected %d)", a, len(a), m)
 	}
 }
 
@@ -211,14 +211,14 @@
 func verify_sliceStr(t *testing.T, x *StringVector, elt, i, j int) {
 	for k := i; k < j; k++ {
 		if elem2StrValue(x.At(k)) != int2StrValue(elt) {
-			t.Errorf("T%: M) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt))
+			t.Errorf("%T: M) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt))
 		}
 	}
 
 	s := x.Slice(i, j)
 	for k, n := 0, j-i; k < n; k++ {
 		if elem2StrValue(s.At(k)) != int2StrValue(elt) {
-			t.Errorf("T%: N) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt))
+			t.Errorf("%T: N) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt))
 		}
 	}
 }
@@ -227,10 +227,10 @@
 func verify_patternStr(t *testing.T, x *StringVector, a, b, c int) {
 	n := a + b + c
 	if x.Len() != n {
-		t.Errorf("T%: O) wrong Len() %d (expected %d)", x, x.Len(), n)
+		t.Errorf("%T: O) wrong Len() %d (expected %d)", x, x.Len(), n)
 	}
 	if len(*x) != n {
-		t.Errorf("T%: O) wrong len() %d (expected %d)", x, len(*x), n)
+		t.Errorf("%T: O) wrong len() %d (expected %d)", x, len(*x), n)
 	}
 	verify_sliceStr(t, x, 0, 0, a)
 	verify_sliceStr(t, x, 1, a, a+b)
diff --git a/src/pkg/container/vector/vector_test.go b/src/pkg/container/vector/vector_test.go
index 986dff2..a9c4ceb 100644
--- a/src/pkg/container/vector/vector_test.go
+++ b/src/pkg/container/vector/vector_test.go
@@ -127,59 +127,59 @@
 
 	for i := 0; i < n; i++ {
 		if a.Len() != i {
-			t.Errorf("T%: A) wrong Len() %d (expected %d)", a, a.Len(), i)
+			t.Errorf("%T: A) wrong Len() %d (expected %d)", a, a.Len(), i)
 		}
 		if len(a) != i {
-			t.Errorf("T%: A) wrong len() %d (expected %d)", a, len(a), i)
+			t.Errorf("%T: A) wrong len() %d (expected %d)", a, len(a), i)
 		}
 		a.Insert(0, int2Value(val(i)))
 		if elem2Value(a.Last()) != int2Value(val(0)) {
-			t.Error("T%: B", a)
+			t.Errorf("%T: B", a)
 		}
 	}
 	for i := n - 1; i >= 0; i-- {
 		if elem2Value(a.Last()) != int2Value(val(0)) {
-			t.Error("T%: C", a)
+			t.Errorf("%T: C", a)
 		}
 		if elem2Value(a.At(0)) != int2Value(val(i)) {
-			t.Error("T%: D", a)
+			t.Errorf("%T: D", a)
 		}
 		if elem2Value(a[0]) != int2Value(val(i)) {
-			t.Error("T%: D2", a)
+			t.Errorf("%T: D2", a)
 		}
 		a.Delete(0)
 		if a.Len() != i {
-			t.Errorf("T%: E) wrong Len() %d (expected %d)", a, a.Len(), i)
+			t.Errorf("%T: E) wrong Len() %d (expected %d)", a, a.Len(), i)
 		}
 		if len(a) != i {
-			t.Errorf("T%: E) wrong len() %d (expected %d)", a, len(a), i)
+			t.Errorf("%T: E) wrong len() %d (expected %d)", a, len(a), i)
 		}
 	}
 
 	if a.Len() != 0 {
-		t.Errorf("T%: F) wrong Len() %d (expected 0)", a, a.Len())
+		t.Errorf("%T: F) wrong Len() %d (expected 0)", a, a.Len())
 	}
 	if len(a) != 0 {
-		t.Errorf("T%: F) wrong len() %d (expected 0)", a, len(a))
+		t.Errorf("%T: F) wrong len() %d (expected 0)", a, len(a))
 	}
 	for i := 0; i < n; i++ {
 		a.Push(int2Value(val(i)))
 		if a.Len() != i+1 {
-			t.Errorf("T%: G) wrong Len() %d (expected %d)", a, a.Len(), i+1)
+			t.Errorf("%T: G) wrong Len() %d (expected %d)", a, a.Len(), i+1)
 		}
 		if len(a) != i+1 {
-			t.Errorf("T%: G) wrong len() %d (expected %d)", a, len(a), i+1)
+			t.Errorf("%T: G) wrong len() %d (expected %d)", a, len(a), i+1)
 		}
 		if elem2Value(a.Last()) != int2Value(val(i)) {
-			t.Error("T%: H", a)
+			t.Errorf("%T: H", a)
 		}
 	}
 	a.Resize(0, 0)
 	if a.Len() != 0 {
-		t.Errorf("T%: I wrong Len() %d (expected 0)", a, a.Len())
+		t.Errorf("%T: I wrong Len() %d (expected 0)", a, a.Len())
 	}
 	if len(a) != 0 {
-		t.Errorf("T%: I wrong len() %d (expected 0)", a, len(a))
+		t.Errorf("%T: I wrong len() %d (expected 0)", a, len(a))
 	}
 
 	const m = 5
@@ -189,21 +189,21 @@
 			x := val(i)
 			a.Push(int2Value(x))
 			if elem2Value(a.Pop()) != int2Value(x) {
-				t.Error("T%: J", a)
+				t.Errorf("%T: J", a)
 			}
 			if a.Len() != j+1 {
-				t.Errorf("T%: K) wrong Len() %d (expected %d)", a, a.Len(), j+1)
+				t.Errorf("%T: K) wrong Len() %d (expected %d)", a, a.Len(), j+1)
 			}
 			if len(a) != j+1 {
-				t.Errorf("T%: K) wrong len() %d (expected %d)", a, len(a), j+1)
+				t.Errorf("%T: K) wrong len() %d (expected %d)", a, len(a), j+1)
 			}
 		}
 	}
 	if a.Len() != m {
-		t.Errorf("T%: L) wrong Len() %d (expected %d)", a, a.Len(), m)
+		t.Errorf("%T: L) wrong Len() %d (expected %d)", a, a.Len(), m)
 	}
 	if len(a) != m {
-		t.Errorf("T%: L) wrong len() %d (expected %d)", a, len(a), m)
+		t.Errorf("%T: L) wrong len() %d (expected %d)", a, len(a), m)
 	}
 }
 
@@ -211,14 +211,14 @@
 func verify_slice(t *testing.T, x *Vector, elt, i, j int) {
 	for k := i; k < j; k++ {
 		if elem2Value(x.At(k)) != int2Value(elt) {
-			t.Errorf("T%: M) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt))
+			t.Errorf("%T: M) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt))
 		}
 	}
 
 	s := x.Slice(i, j)
 	for k, n := 0, j-i; k < n; k++ {
 		if elem2Value(s.At(k)) != int2Value(elt) {
-			t.Errorf("T%: N) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt))
+			t.Errorf("%T: N) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt))
 		}
 	}
 }
@@ -227,10 +227,10 @@
 func verify_pattern(t *testing.T, x *Vector, a, b, c int) {
 	n := a + b + c
 	if x.Len() != n {
-		t.Errorf("T%: O) wrong Len() %d (expected %d)", x, x.Len(), n)
+		t.Errorf("%T: O) wrong Len() %d (expected %d)", x, x.Len(), n)
 	}
 	if len(*x) != n {
-		t.Errorf("T%: O) wrong len() %d (expected %d)", x, len(*x), n)
+		t.Errorf("%T: O) wrong len() %d (expected %d)", x, len(*x), n)
 	}
 	verify_slice(t, x, 0, 0, a)
 	verify_slice(t, x, 1, a, a+b)
diff --git a/src/pkg/crypto/elliptic/elliptic_test.go b/src/pkg/crypto/elliptic/elliptic_test.go
index a04b1fa..25c2071 100644
--- a/src/pkg/crypto/elliptic/elliptic_test.go
+++ b/src/pkg/crypto/elliptic/elliptic_test.go
@@ -290,7 +290,7 @@
 	for i, e := range p224BaseMultTests {
 		k, ok := new(big.Int).SetString(e.k, 10)
 		if !ok {
-			t.Errorf("%d: bad value for k: %s", e.k)
+			t.Errorf("%d: bad value for k: %s", i, e.k)
 		}
 		x, y := p224.ScalarBaseMult(k.Bytes())
 		if fmt.Sprintf("%x", x) != e.x || fmt.Sprintf("%x", y) != e.y {
diff --git a/src/pkg/fmt/scan_test.go b/src/pkg/fmt/scan_test.go
index 7a0baae..fe5ee1d 100644
--- a/src/pkg/fmt/scan_test.go
+++ b/src/pkg/fmt/scan_test.go
@@ -532,7 +532,7 @@
 		t.Errorf("Sscan count error: expected 1: got %d", n)
 	}
 	if err == nil {
-		t.Errorf("Sscan expected error; got none", err)
+		t.Errorf("Sscan expected error; got none: %s", err)
 	}
 	if s != "asdf" {
 		t.Errorf("Sscan wrong values: got %q expected \"asdf\"", s)
@@ -547,7 +547,7 @@
 		t.Errorf("Sscan count error: expected 1: got %d", n)
 	}
 	if err == nil {
-		t.Errorf("Sscan <one item> expected error; got none")
+		t.Error("Sscan <one item> expected error; got none")
 	}
 	if s1 != "abc" {
 		t.Errorf("Sscan wrong values: got %q expected \"abc\"", s1)
@@ -557,7 +557,7 @@
 		t.Errorf("Sscan count error: expected 0: got %d", n)
 	}
 	if err == nil {
-		t.Errorf("Sscan <empty> expected error; got none")
+		t.Error("Sscan <empty> expected error; got none")
 	}
 	// Quoted empty string is OK.
 	n, err = Sscanf(`""`, "%q", &s1)
diff --git a/src/pkg/gob/codec_test.go b/src/pkg/gob/codec_test.go
index a95cfa9..3fe5fe2 100644
--- a/src/pkg/gob/codec_test.go
+++ b/src/pkg/gob/codec_test.go
@@ -829,7 +829,7 @@
 	dec := NewDecoder(b)
 	err := dec.Decode(&drt)
 	if err != nil {
-		t.Errorf("decoder error:", err)
+		t.Error("decoder error:", err)
 	}
 	if drt.a != rt.a {
 		t.Errorf("nesting: encode expected %v got %v", *rt, drt)
@@ -1196,7 +1196,7 @@
 			}
 			continue
 			if v1.Square() != v2.Square() {
-				t.Errorf("item %d inconsistent values: %v %v", v1, v2)
+				t.Errorf("item %d inconsistent values: %v %v", i, v1, v2)
 			}
 		}
 	}
diff --git a/src/pkg/json/scanner_test.go b/src/pkg/json/scanner_test.go
index b90f581..2dc8ff8 100644
--- a/src/pkg/json/scanner_test.go
+++ b/src/pkg/json/scanner_test.go
@@ -138,7 +138,7 @@
 	var scan scanner
 	item, rest, err := nextValue(jsonBig, &scan)
 	if err != nil {
-		t.Fatalf("nextValue: ", err)
+		t.Fatalf("nextValue: %s", err)
 	}
 	if len(item) != len(jsonBig) || &item[0] != &jsonBig[0] {
 		t.Errorf("invalid item: %d %d", len(item), len(jsonBig))
@@ -149,7 +149,7 @@
 
 	item, rest, err = nextValue(append(jsonBig, []byte("HELLO WORLD")...), &scan)
 	if err != nil {
-		t.Fatalf("nextValue extra: ", err)
+		t.Fatalf("nextValue extra: %s", err)
 	}
 	if len(item) != len(jsonBig) {
 		t.Errorf("invalid item: %d %d", len(item), len(jsonBig))
diff --git a/src/pkg/json/stream_test.go b/src/pkg/json/stream_test.go
index ab90b75..c83cfe3 100644
--- a/src/pkg/json/stream_test.go
+++ b/src/pkg/json/stream_test.go
@@ -71,10 +71,10 @@
 			}
 		}
 		if !reflect.DeepEqual(out, streamTest[0:i]) {
-			t.Errorf("decoding %d items: mismatch")
+			t.Errorf("decoding %d items: mismatch", i)
 			for j := range out {
 				if !reflect.DeepEqual(out[j], streamTest[j]) {
-					t.Errorf("#%d: have %v want %v", out[j], streamTest[j])
+					t.Errorf("#%d: have %v want %v", j, out[j], streamTest[j])
 				}
 			}
 			break
diff --git a/src/pkg/netchan/netchan_test.go b/src/pkg/netchan/netchan_test.go
index 707111a..766c4c4 100644
--- a/src/pkg/netchan/netchan_test.go
+++ b/src/pkg/netchan/netchan_test.go
@@ -79,7 +79,7 @@
 			break
 		}
 		if v != 23+i {
-			t.Errorf("importReceive: bad value: expected %%d+%d=%d; got %+d", base, i, base+i, v)
+			t.Errorf("importReceive: bad value: expected %d+%d=%d; got %+d", base, i, base+i, v)
 		}
 	}
 	if done != nil {
diff --git a/src/pkg/os/os_test.go b/src/pkg/os/os_test.go
index 0bbb686..d60a52f 100644
--- a/src/pkg/os/os_test.go
+++ b/src/pkg/os/os_test.go
@@ -165,7 +165,7 @@
 	}
 	s, err2 := file.Readdirnames(-1)
 	if err2 != nil {
-		t.Fatalf("readdirnames %q failed: %v", err2)
+		t.Fatalf("readdirnames %q failed: %v", dir, err2)
 	}
 	for _, m := range contents {
 		found := false
@@ -264,7 +264,7 @@
 	small := smallReaddirnames(file1, len(all)+100, t) // +100 in case we screw up
 	for i, n := range all {
 		if small[i] != n {
-			t.Errorf("small read %q %q mismatch: %v", small[i], n)
+			t.Errorf("small read %q mismatch: %v", small[i], n)
 		}
 	}
 }
@@ -348,7 +348,7 @@
 		t.Fatalf("stat %q failed: %v", from, err)
 	}
 	if !fromstat.FollowedSymlink {
-		t.Fatalf("stat %q did not follow symlink")
+		t.Fatalf("stat %q did not follow symlink", from)
 	}
 	s, err := Readlink(from)
 	if err != nil {
diff --git a/src/pkg/os/path_test.go b/src/pkg/os/path_test.go
index 9bc92ae..c662882 100644
--- a/src/pkg/os/path_test.go
+++ b/src/pkg/os/path_test.go
@@ -35,7 +35,7 @@
 	// Can't make directory named after file.
 	err = MkdirAll(fpath, 0777)
 	if err == nil {
-		t.Fatalf("MkdirAll %q: no error")
+		t.Fatalf("MkdirAll %q: no error", fpath)
 	}
 	perr, ok := err.(*PathError)
 	if !ok {
@@ -49,7 +49,7 @@
 	ffpath := fpath + "/subdir"
 	err = MkdirAll(ffpath, 0777)
 	if err == nil {
-		t.Fatalf("MkdirAll %q: no error")
+		t.Fatalf("MkdirAll %q: no error", ffpath)
 	}
 	perr, ok = err.(*PathError)
 	if !ok {
@@ -135,7 +135,7 @@
 			if err == nil {
 				t.Errorf("Can lstat %q after supposed RemoveAll", path)
 			}
-			t.Fatalf("RemoveAll %q succeeded with chmod 0 subdirectory", path, err)
+			t.Fatalf("RemoveAll %q succeeded with chmod 0 subdirectory: err %s", path, err)
 		}
 		perr, ok := err.(*PathError)
 		if !ok {
diff --git a/src/pkg/path/path_test.go b/src/pkg/path/path_test.go
index e00ac09..971f32e 100644
--- a/src/pkg/path/path_test.go
+++ b/src/pkg/path/path_test.go
@@ -257,7 +257,7 @@
 	errors := make(chan os.Error, 64)
 	Walk(tree.name, v, errors)
 	if err, ok := <-errors; ok {
-		t.Errorf("no error expected, found: s", err)
+		t.Error("no error expected, found: s", err)
 	}
 	checkMarks(t)
 
diff --git a/src/pkg/reflect/all_test.go b/src/pkg/reflect/all_test.go
index 25e429a..e745ab8 100644
--- a/src/pkg/reflect/all_test.go
+++ b/src/pkg/reflect/all_test.go
@@ -873,7 +873,7 @@
 		// Check that value lookup is correct.
 		vv := mv.Elem(NewValue(k))
 		if vi := vv.(*IntValue).Get(); vi != int64(v) {
-			t.Errorf("Key %q: have value %d, want %d", vi, v)
+			t.Errorf("Key %q: have value %d, want %d", k, vi, v)
 		}
 
 		// Copy into new map.
diff --git a/src/pkg/strconv/atob_test.go b/src/pkg/strconv/atob_test.go
index 7a95456..497df5b 100644
--- a/src/pkg/strconv/atob_test.go
+++ b/src/pkg/strconv/atob_test.go
@@ -46,7 +46,7 @@
 			}
 		} else {
 			if e != nil {
-				t.Errorf("%s: expected no error but got %s", test.in, test.err, e)
+				t.Errorf("%s: expected no error but got %s", test.in, e)
 			}
 			if b != test.out {
 				t.Errorf("%s: expected %t but got %t", test.in, test.out, b)
diff --git a/src/pkg/syslog/syslog_test.go b/src/pkg/syslog/syslog_test.go
index eeae102..063ab71 100644
--- a/src/pkg/syslog/syslog_test.go
+++ b/src/pkg/syslog/syslog_test.go
@@ -47,7 +47,7 @@
 func TestNewLogger(t *testing.T) {
 	f := NewLogger(LOG_INFO, 0)
 	if f == nil {
-		t.Errorf("NewLogger() failed")
+		t.Error("NewLogger() failed")
 	}
 }
 
diff --git a/src/pkg/time/tick_test.go b/src/pkg/time/tick_test.go
index d089a9b..2a63a0f 100644
--- a/src/pkg/time/tick_test.go
+++ b/src/pkg/time/tick_test.go
@@ -31,7 +31,7 @@
 	Sleep(2 * Delta)
 	_, received := <-ticker.C
 	if received {
-		t.Fatalf("Ticker did not shut down")
+		t.Fatal("Ticker did not shut down")
 	}
 }
 
diff --git a/src/pkg/unicode/maketables.go b/src/pkg/unicode/maketables.go
index 4c6d83f..c8e7eb4 100644
--- a/src/pkg/unicode/maketables.go
+++ b/src/pkg/unicode/maketables.go
@@ -329,7 +329,7 @@
 		for k, _ := range category {
 			fmt.Printf("\t%q: %s,\n", k, k)
 		}
-		fmt.Printf("}\n\n")
+		fmt.Print("}\n\n")
 	}
 
 	decl := make(sort.StringArray, len(list))
@@ -377,7 +377,7 @@
 	for _, d := range decl {
 		fmt.Print(d)
 	}
-	fmt.Println(")\n")
+	fmt.Print(")\n\n")
 }
 
 type Op func(code int) bool
@@ -597,7 +597,7 @@
 		for k, _ := range table {
 			fmt.Printf("\t%q: %s,\n", k, k)
 		}
-		fmt.Printf("}\n\n")
+		fmt.Print("}\n\n")
 	}
 
 	decl := make(sort.StringArray, len(list))
@@ -618,14 +618,14 @@
 		for _, s := range ranges {
 			fmt.Printf(format, s.Lo, s.Hi, s.Stride)
 		}
-		fmt.Printf("}\n\n")
+		fmt.Print("}\n\n")
 	}
 	decl.Sort()
 	fmt.Println("var (")
 	for _, d := range decl {
 		fmt.Print(d)
 	}
-	fmt.Println(")\n")
+	fmt.Print(")\n\n")
 }
 
 const (
@@ -792,7 +792,7 @@
 		}
 		prevState = state
 	}
-	fmt.Printf("}\n")
+	fmt.Print("}\n")
 }
 
 func printCaseRange(lo, hi *caseState) {
diff --git a/src/pkg/utf8/string_test.go b/src/pkg/utf8/string_test.go
index 0733b06..9dd8472 100644
--- a/src/pkg/utf8/string_test.go
+++ b/src/pkg/utf8/string_test.go
@@ -15,7 +15,7 @@
 		runes := []int(s)
 		str := NewString(s)
 		if str.RuneCount() != len(runes) {
-			t.Error("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
+			t.Errorf("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
 			break
 		}
 		for i, expect := range runes {
@@ -32,7 +32,7 @@
 		runes := []int(s)
 		str := NewString(s)
 		if str.RuneCount() != len(runes) {
-			t.Error("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
+			t.Errorf("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
 			break
 		}
 		for i := len(runes) - 1; i >= 0; i-- {
@@ -55,7 +55,7 @@
 		runes := []int(s)
 		str := NewString(s)
 		if str.RuneCount() != len(runes) {
-			t.Error("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
+			t.Errorf("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
 			break
 		}
 		for j := 0; j < randCount; j++ {
@@ -77,7 +77,7 @@
 		runes := []int(s)
 		str := NewString(s)
 		if str.RuneCount() != len(runes) {
-			t.Error("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
+			t.Errorf("%s: expected %d runes; got %d", s, len(runes), str.RuneCount())
 			break
 		}
 		for k := 0; k < randCount; k++ {
diff --git a/src/pkg/utf8/utf8_test.go b/src/pkg/utf8/utf8_test.go
index 59896aa..7a1db93 100644
--- a/src/pkg/utf8/utf8_test.go
+++ b/src/pkg/utf8/utf8_test.go
@@ -166,7 +166,7 @@
 	for _, ts := range testStrings {
 		runes := []int(ts)
 		if RuneCountInString(ts) != len(runes) {
-			t.Error("%q: expected %d runes; got %d", ts, len(runes), RuneCountInString(ts))
+			t.Errorf("%q: expected %d runes; got %d", ts, len(runes), RuneCountInString(ts))
 			break
 		}
 		i := 0
diff --git a/src/pkg/websocket/websocket_test.go b/src/pkg/websocket/websocket_test.go
index c66c114..cc4b9dc 100644
--- a/src/pkg/websocket/websocket_test.go
+++ b/src/pkg/websocket/websocket_test.go
@@ -155,7 +155,7 @@
 	// specification, the server should abort the WebSocket connection.
 	_, _, err := http.Get(fmt.Sprintf("http://%s/echo", serverAddr))
 	if err == nil {
-		t.Errorf("Get: unexpected success")
+		t.Error("Get: unexpected success")
 		return
 	}
 	urlerr, ok := err.(*http.URLError)
diff --git a/src/pkg/xml/xml_test.go b/src/pkg/xml/xml_test.go
index 0068896..2c73fcc 100644
--- a/src/pkg/xml/xml_test.go
+++ b/src/pkg/xml/xml_test.go
@@ -301,7 +301,7 @@
 	err := Unmarshal(buf, &i)
 
 	if err != nil || i.Field_a != "abcd" {
-		t.Fatalf("Expecting abcd")
+		t.Fatal("Expecting abcd")
 	}
 }