Remove unused code + handle errors

This commit is contained in:
William Gotti 2019-05-13 12:42:29 +00:00 committed by Daniel Huigens
parent e797299d64
commit b820c14c1a
7 changed files with 26 additions and 12 deletions

View file

@ -51,7 +51,9 @@ func PublicKey(privateKey string) (string, error) {
var outBuf bytes.Buffer
for _, e := range entries {
e.Serialize(&outBuf)
if err := e.Serialize(&outBuf); err != nil {
return "", err
}
}
outString, err := armor.ArmorWithType(outBuf.Bytes(), constants.PublicKeyHeader)
@ -72,7 +74,9 @@ func PublicKeyBinOut(privateKey string) ([]byte, error) {
var outBuf bytes.Buffer
for _, e := range entries {
e.Serialize(&outBuf)
if err := e.Serialize(&outBuf); err != nil {
return nil, err
}
}
return outBuf.Bytes(), nil