From edb3e19cb5543c580261052395d461fa47c7cf58 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 29 Apr 2017 14:50:58 +0200 Subject: fix golint complaints --- internal/exitcodes/exitcodes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/exitcodes') 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 { -- cgit v1.2.3