From c18b790725200baaffbcfdb32907f3cd1b6d9be1 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 1 May 2017 17:30:41 +0200 Subject: Consistent name for encFile --- 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 265117e..f8bfa58 100644 --- a/file/names.go +++ b/file/names.go @@ -7,18 +7,18 @@ import ( var ErrNames = errors.New("please use naming scheme of keyname.pub and keyname.sec") -func Names(pubFile, secFile string) error { +func Names(pubFile, encFile string) error { pubFile = filepath.Base(pubFile) - secFile = filepath.Base(secFile) + encFile = filepath.Base(encFile) pubExt := filepath.Ext(pubFile) - secExt := filepath.Ext(secFile) - if pubExt != ".pub" || secExt != ".sec" || pubFile[:len(pubExt)-1] != secFile[:len(secExt)-1] { + encExt := filepath.Ext(encFile) + if pubExt != ".pub" || encExt != ".sec" || pubFile[:len(pubExt)-1] != encFile[:len(encExt)-1] { return ErrNames } return nil } -func PubName(secFile string) string { - ext := filepath.Ext(secFile) - return filepath.Base(secFile[:len(ext)-1] + ".pub") +func PubName(encFile string) string { + ext := filepath.Ext(encFile) + return filepath.Base(encFile[:len(ext)-1] + ".pub") } -- cgit v1.2.3