]> Cypherpunks repositories - gostls13.git/commitdiff
src/*: fix incorrect prints found by govet
authorRob Pike <r@golang.org>
Thu, 10 Feb 2011 01:11:01 +0000 (17:11 -0800)
committerRob Pike <r@golang.org>
Thu, 10 Feb 2011 01:11:01 +0000 (17:11 -0800)
R=gri
CC=golang-dev
https://golang.org/cl/4169044

src/pkg/crypto/cipher/ocfb_test.go
src/pkg/crypto/openpgp/packet/packet_test.go
src/pkg/exp/eval/stmt.go
src/pkg/template/template_test.go

index 7aae27bec910334d5be46a29a56c4812a80dd6e7..40938b589233819bdbadbee3c6f51faebcda1293 100644 (file)
@@ -27,7 +27,7 @@ func testOCFB(t *testing.T, resync OCFBResyncOption) {
 
        ocfbdec := NewOCFBDecrypter(block, prefix, resync)
        if ocfbdec == nil {
-               t.Error("NewOCFBDecrypter failed (resync: %t)", resync)
+               t.Errorf("NewOCFBDecrypter failed (resync: %t)", resync)
                return
        }
        plaintextCopy := make([]byte, len(plaintext))
index 050b7341fb8dea1ca5560f03d260a0d8d21708d1..6789d2abc792b30967bc999b1b0c1f6b6ec0b5bc 100644 (file)
@@ -115,7 +115,7 @@ func TestPartialLengthReader(t *testing.T) {
 
                got := fmt.Sprintf("%x", out)
                if got != test.hexOutput {
-                       t.Errorf("%d: got:%s want:%s", test.hexOutput, got)
+                       t.Errorf("%d: got:%s want:%s", i, test.hexOutput, got)
                }
        }
 }
index 77ff066d09cdbcd50112a9b6c47ced532e185580..5c5d4338a1d87598b08ceaa2da5891f4531052d0 100644 (file)
@@ -908,7 +908,7 @@ func (a *stmtCompiler) compileBranchStmt(s *ast.BranchStmt) {
                return
 
        default:
-               log.Panic("Unexpected branch token %v", s.Tok)
+               log.Panicf("Unexpected branch token %v", s.Tok)
        }
 
        a.flow.put1(false, pc)
index 9df3ab59c001ba6c82ece467aaa73dd664165afc..d21a5397a15a1070e62d9b08643e6166e6f6d448 100644 (file)
@@ -740,7 +740,7 @@ func TestFormatters(t *testing.T) {
                                continue
                        }
                        if strings.Index(err.String(), c.err) < 0 {
-                               t.Error("unexpected error: expected %q, got %q", c.err, err.String())
+                               t.Errorf("unexpected error: expected %q, got %q", c.err, err.String())
                                continue
                        }
                } else {