From 2a3d84824a99e52f6e0c44dd2afe010d5a3f9d6a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 28 Jan 2014 21:52:36 -0800 Subject: [PATCH] jsonsign: update old code to use fmt.Errorf Change-Id: Iedd969e336dd02af6b3bc60590bfc7aa9ea9c89e --- pkg/jsonsign/keys.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/jsonsign/keys.go b/pkg/jsonsign/keys.go index 9cee040ab..9a54efc78 100644 --- a/pkg/jsonsign/keys.go +++ b/pkg/jsonsign/keys.go @@ -62,8 +62,8 @@ func VerifyPublicKeyFile(file, keyid string) (bool, error) { } keyId := publicKeyId(key) if keyId != strings.ToUpper(keyid) { - return false, errors.New(fmt.Sprintf("Key in file %q has id %q; expected %q", - file, keyId, keyid)) + return false, fmt.Errorf("Key in file %q has id %q; expected %q", + file, keyId, keyid) } return true, nil } @@ -87,12 +87,12 @@ func openArmoredPublicKeyFile(reader io.ReadCloser) (*packet.PublicKey, error) { } p, err := packet.Read(block.Body) if err != nil { - return nil, errors.New(fmt.Sprintf("Invalid public key blob: %v", err)) + return nil, fmt.Errorf("Invalid public key blob: %v", err) } pk, ok := p.(*packet.PublicKey) if !ok { - return nil, errors.New(fmt.Sprintf("Invalid public key blob; not a public key packet")) + return nil, fmt.Errorf("Invalid public key blob; not a public key packet") } return pk, nil }