go-spectre @main -
refs -
log -
-
https://git.jolheiser.com/go-spectre.git
Go implementation for spectre/masterpassword
Better parsing error for scope and template
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmGdvZkACgkQuFOtpdp7
v3r3Pw//cetPT8ug7QMS/ZCGCmZ7RETe78eQxUo/e1z34BxPAdN2G6tsaPAcnJ2E
o5pq0iYq6yFyfA1v4zSh9wGGMEn7dbSjouxdxmFEZo0HVfBEzev+pWwHUYMUeN30
vKZnZIykqPvLs11f7CRp9G55K+HI+ZsnZws1lZZ96okUKZxEUnPZWEmUTzUcO6df
rb6NG7EyIR5YdFqY0XUeW8GgtOT0A1JSc6sDeUv+QP67P7ae6RS16Qgj4eGRjY+y
1BQNW+nHjwbYmMoSbz323g/F7mDqjCrFc5AadnGbAUW5Xuh8H1a/GadDc8dRzf8g
YszMgoMJoaRc4XFA8X8aTfGk8YUWDOsqOziOeC1VPvJX/GHW9thDRoy7Usx/yyhq
WihbwNWMZyLpQpWjtOvYPsIcHu05A3mUC9gmvdMjLVRSpGzcYBm+1WDIiFG8DzxM
ZS1HhuJVl7+rnwpuMo9LfAbwkaKb5xPu20uoy0zwdTMEhdUlgKpk5cohzY+LDWfG
9Mn0zZtcG/SIob2nQIoi5/+k6Yr53o9v2lselxN9uGmAowPgWwprVYSF/gwA4T2o
G1Lsak0zy8yKchuzqTFK0tX6iO5s+nKV6lNy0Hh2yX+ySoEboHNO7IHSGwpOibKq
qKRbKP/0oXBf0M62KWm97zWksH85jJMkQF7on/RJRJjOg77j6io=
=IABH
-----END PGP SIGNATURE-----
2 changed files, 4 additions(+), 4 deletions(-)
diff --git a/scope.go b/scope.go
index 8480e0569397ef22f59c3a47ab8b810a17422f33..8549cce16d8717dcb92839da77bbb12d6c4cac6a 100644
--- a/scope.go
+++ b/scope.go
@@ -1,7 +1,7 @@
package spectre
import (
- "errors"
+ "fmt"
"strings"
)
@@ -41,7 +41,7 @@ return Identification, nil
case "recovery", "r":
return Recovery, nil
default:
- return "", errors.New("unknown Scope")
+ return "", fmt.Errorf("unknown Scope %q; available [authentication, identification, recovery]", s)
}
}
diff --git a/template.go b/template.go
index 5fb3ca2787aefe4d555616eef98e939582178659..a0b4eb9413d7edd9701c42f441e6bc0c31596ede 100644
--- a/template.go
+++ b/template.go
@@ -1,7 +1,7 @@
package spectre
import (
- "errors"
+ "fmt"
"strings"
)
@@ -39,7 +39,7 @@ return Phrase, nil
case "basic":
return Basic, nil
default:
- return "", errors.New("unknown Template")
+ return "", fmt.Errorf("unknown Template %q; available [maximum, long, medium, short, pin, name, phrase, basic]", s)
}
}