From ca42274656feba4c384a502dd6fe622f104eb092 Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Tue, 1 May 2018 23:22:29 -0400 Subject: [PATCH] if block ends with a return statement drop this else and outdent its block --- session/session_core_handlers.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/session/session_core_handlers.go b/session/session_core_handlers.go index 05c281a8..d9f05279 100644 --- a/session/session_core_handlers.go +++ b/session/session_core_handlers.go @@ -148,9 +148,8 @@ func (s *Session) sleepHandler(args []string, sess *Session) error { if secs, err := strconv.Atoi(args[0]); err == nil { time.Sleep(time.Duration(secs) * time.Second) return nil - } else { - return err } + return err } func (s *Session) getHandler(args []string, sess *Session) error { @@ -257,9 +256,8 @@ func (s *Session) aliasHandler(args []string, sess *Session) error { if s.Lan.SetAliasFor(mac, alias) { return nil - } else { - return fmt.Errorf("Could not find endpoint %s", mac) } + return fmt.Errorf("Could not find endpoint %s", mac) } func (s *Session) addHandler(h CommandHandler, c *readline.PrefixCompleter) {