Use fmt.Errorf

This commit is contained in:
Adam Schmideg 2020-02-26 12:46:42 +01:00
parent f39afd5df1
commit 0a22d23f6d

View file

@ -168,7 +168,7 @@ func LoadECDSA(file string) (*ecdsa.PrivateKey, error) {
return nil, err
}
if len(buf) != 64 {
return nil, errors.New(fmt.Sprintf("expected 64 hexa characters, got %v", len(buf)))
return nil, fmt.Errorf("expected 64 hexa characters, got %v", len(buf))
}
key, err := hex.DecodeString(string(buf))