diff options
author | Wagner Riffel <wgrriffel@gmail.com> | 2019-09-03 16:34:06 -0300 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-04 16:30:57 -1000 |
commit | bdb5e3e6581169bdb1d912c158336f409151b491 (patch) | |
tree | 71aeb42039a5b717b5aa881dfdac28ddb6c3d86b /commands/account/next.go | |
parent | baa70469c3b25e1b937c9c2a9e0b16762a227bca (diff) |
commands: move ParseNextPrevMessage error value to its last return value
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
Diffstat (limited to 'commands/account/next.go')
-rw-r--r-- | commands/account/next.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/commands/account/next.go b/commands/account/next.go index e1d3eeb..5e4838e 100644 --- a/commands/account/next.go +++ b/commands/account/next.go @@ -23,8 +23,8 @@ func (NextPrevMsg) Complete(aerc *widgets.Aerc, args []string) []string { return nil } - var err, n, pct = ParseNextPrevMessage(args) func (NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error { + n, pct, err := ParseNextPrevMessage(args) if err != nil { return err } @@ -35,9 +35,9 @@ func (NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error { return ExecuteNextPrevMessage(args, acct, pct, n) } -func ParseNextPrevMessage(args []string) (error, int, bool) { +func ParseNextPrevMessage(args []string) (int, bool, error) { if len(args) > 2 { - return nextPrevMessageUsage(args[0]), 0, false + return 0, false, nextPrevMessageUsage(args[0]) } var ( n int = 1 @@ -51,10 +51,10 @@ func ParseNextPrevMessage(args []string) (error, int, bool) { } n, err = strconv.Atoi(args[1]) if err != nil { - return nextPrevMessageUsage(args[0]), 0, false + return 0, false, nextPrevMessageUsage(args[0]) } } - return nil, n, pct + return n, pct, nil } func ExecuteNextPrevMessage(args []string, acct *widgets.AccountView, pct bool, n int) error { |