aboutsummaryrefslogtreecommitdiff
path: root/internal/exitcodes
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-04-29 14:50:58 +0200
committerJakob Unterwurzacher2017-04-29 14:50:58 +0200
commitedb3e19cb5543c580261052395d461fa47c7cf58 (patch)
tree293271bda453e8120fe271d2d146a73d852b90ca /internal/exitcodes
parent7d38f80a78644c8ec4900cc990bfb894387112ed (diff)
fix golint complaints
Diffstat (limited to 'internal/exitcodes')
-rw-r--r--internal/exitcodes/exitcodes.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/exitcodes/exitcodes.go b/internal/exitcodes/exitcodes.go
index 908e714..ae00118 100644
--- a/internal/exitcodes/exitcodes.go
+++ b/internal/exitcodes/exitcodes.go
@@ -10,12 +10,13 @@ import (
const (
// Other error - please inspect the message
Other = 11
- // The password was incorrect
+ // PasswordIncorrect - the password was incorrect
PasswordIncorrect = 12
// TODO several other exit codes are defined in main.go. These will be
// ported over here.
)
+// Err wraps and error with an associated numeric exit code
type Err struct {
error
code int
@@ -29,6 +30,8 @@ func NewErr(msg string, code int) Err {
}
}
+// Exit extracts the numeric exit code from "err" (if available) and exits the
+// application.
func Exit(err error) {
err2, ok := err.(Err)
if !ok {