1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:10:04 -07:00

pkg: fix new incorrect prints found by govet

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4539063
This commit is contained in:
Robert Hencke 2011-05-16 21:15:06 -07:00 committed by Brad Fitzpatrick
parent 4fb5857596
commit 3faa490f89
2 changed files with 3 additions and 3 deletions

View File

@ -291,14 +291,14 @@ func TestParseCertificateWithDsaPublicKey(t *testing.T) {
pemBlock, _ := pem.Decode([]byte(dsaCertPem)) pemBlock, _ := pem.Decode([]byte(dsaCertPem))
cert, err := ParseCertificate(pemBlock.Bytes) cert, err := ParseCertificate(pemBlock.Bytes)
if err != nil { if err != nil {
t.Fatal("Failed to parse certificate: %s", err) t.Fatalf("Failed to parse certificate: %s", err)
} }
if cert.PublicKeyAlgorithm != DSA { if cert.PublicKeyAlgorithm != DSA {
t.Errorf("Parsed key algorithm was not DSA") t.Errorf("Parsed key algorithm was not DSA")
} }
parsedKey, ok := cert.PublicKey.(*dsa.PublicKey) parsedKey, ok := cert.PublicKey.(*dsa.PublicKey)
if !ok { if !ok {
t.Fatal("Parsed key was not a DSA key: %s", err) t.Fatalf("Parsed key was not a DSA key: %s", err)
} }
if expectedKey.Y.Cmp(parsedKey.Y) != 0 || if expectedKey.Y.Cmp(parsedKey.Y) != 0 ||
expectedKey.P.Cmp(parsedKey.P) != 0 || expectedKey.P.Cmp(parsedKey.P) != 0 ||

View File

@ -243,7 +243,7 @@ func smallReaddirnames(file *File, length int, t *testing.T) []string {
t.Fatalf("readdirnames %q failed: %v", file.Name(), err) t.Fatalf("readdirnames %q failed: %v", file.Name(), err)
} }
if len(d) == 0 { if len(d) == 0 {
t.Fatalf("readdirnames %q returned empty slice and no error") t.Fatalf("readdirnames %q returned empty slice and no error", file.Name())
} }
names[count] = d[0] names[count] = d[0]
count++ count++