aboutsummaryrefslogtreecommitdiff
path: root/file
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-05-01 17:30:41 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-05-01 17:30:41 +0200
commitc18b790725200baaffbcfdb32907f3cd1b6d9be1 (patch)
tree4520807330c83050126024db8013add47a87c4bd /file
parenta3e526f9b89aa52c21cf8da02a5ddf6682795b1b (diff)
Consistent name for encFile
Diffstat (limited to 'file')
-rw-r--r--file/names.go14
1 files changed, 7 insertions, 7 deletions
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")
}