From 4fbfd1286c60f1041f706355addddf3edb9ed81f Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 18 Apr 2017 21:44:09 +0200 Subject: ... --- file.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'file.go') diff --git a/file.go b/file.go index c0d60ea..6bff903 100644 --- a/file.go +++ b/file.go @@ -21,18 +21,21 @@ type File struct { const ( commentHdr = "untrusted comment:" verifyWith = "verify with" - pubKey = "%s public key" - secKey = "%s secret key" sigFrom = "signature from %s" ) +var ( + ErrCommentSize = errors.New("comment line to long") + ErrUntrustedComment = errors.New("expected untrusted comment") +) + func checkComment(comment string) error { // compatibility with original version if len(comment) > 1024 { - return errors.New("comment line to long") + return ErrCommentSize } if !strings.HasPrefix(comment, commentHdr) { - return errors.New("expected untrusted comment") + return ErrUntrustedComment } return nil } -- cgit v1.2.3