According to the docs[1], the OpenPGP armor.Decode function should return
an error if it's presented with input that does *not* represent a valid
armored text string:
> Decode reads a PGP armored block from the given Reader. It will ignore
> leading garbage. If it doesn't find a block, it will return nil, io.EOF.
My experience, however, is it will *never* return a non-nil error under
any circumstances (I have been using it to validate armored public
keys versus other types of inputs), and it's only when I try to use the
resulting Block for encoding do I see any errors.
Is this the expected behavior, or is it a bug in the Decode function?
[1]
https://godoc.org/golang.org/x/crypto/openpgp/armor#Decode