aboutsummaryrefslogtreecommitdiff
path: root/file
diff options
context:
space:
mode:
Diffstat (limited to 'file')
-rw-r--r--file/names.go4
-rw-r--r--file/names_test.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/file/names.go b/file/names.go
index 3835bbd..15e480e 100644
--- a/file/names.go
+++ b/file/names.go
@@ -13,7 +13,7 @@ var ErrNames = errors.New("please use naming scheme of keyname.pub and keyname.s
const (
PubExt = ".pub"
- EncExt = ".enc"
+ EncExt = ".sec"
SigExt = ".sig"
)
@@ -23,7 +23,7 @@ func splitNameExt(fname string) (string, string) {
return file[:len(file)-len(ext)], ext
}
-func Names(pubFile, encFile string) error {
+func CheckNames(pubFile, encFile string) error {
pubName, pubExt := splitNameExt(pubFile)
encName, encExt := splitNameExt(encFile)
if pubExt != PubExt || encExt != EncExt || pubName != encName {
diff --git a/file/names_test.go b/file/names_test.go
index 38e374d..b6a28c0 100644
--- a/file/names_test.go
+++ b/file/names_test.go
@@ -2,7 +2,7 @@ package file
import "testing"
-func TestNames(t *testing.T) {
+func TestCheckNames(t *testing.T) {
testCases := []struct {
pub, sec string
err error
@@ -15,7 +15,7 @@ func TestNames(t *testing.T) {
}
for _, tc := range testCases {
t.Run(tc.pub+"+"+tc.sec, func(t *testing.T) {
- err := Names(tc.pub, tc.sec)
+ err := CheckNames(tc.pub, tc.sec)
if err != tc.err {
t.Errorf("got %v, want %v", err, tc.err)
}