From 192414f67f722599467ab621c7348e41574fd759 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 19 Jul 2017 00:39:44 +0200 Subject: unexport --- file/names.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'file') diff --git a/file/names.go b/file/names.go index 6bf440b..1ef1246 100644 --- a/file/names.go +++ b/file/names.go @@ -11,9 +11,9 @@ import ( var ErrNames = errors.New("please use naming scheme of keyname.pub and keyname.sec") const ( - PubExt = ".pub" - EncExt = ".sec" - SigExt = ".sig" + extPub = ".pub" + extEnc = ".sec" + extSig = ".sig" verifyWith = "verify with " ) @@ -26,7 +26,7 @@ func splitNameExt(fname string) (string, string) { func CheckNames(pubFile, encFile string) error { pubName, pubExt := splitNameExt(pubFile) encName, encExt := splitNameExt(encFile) - if pubExt != PubExt || encExt != EncExt || pubName != encName { + if pubExt != extPub || encExt != extEnc || pubName != encName { return ErrNames } return nil @@ -34,17 +34,17 @@ func CheckNames(pubFile, encFile string) error { func PubName(encFile string) string { ext := filepath.Ext(encFile) - return filepath.Base(encFile[:len(ext)-1] + PubExt) + return filepath.Base(encFile[:len(ext)-1] + extPub) } func SigName(msgFile string) string { - return msgFile + SigExt + return msgFile + extSig } func PubFile(comment string) (string, bool) { if strings.HasPrefix(comment, verifyWith) { file := comment[len(verifyWith):] - if strings.HasSuffix(file, PubExt) { + if strings.HasSuffix(file, extPub) { return FindFile(file), true } } -- cgit v1.2.3