From 907d1702d98317be2dfc87b69760f156352b2917 Mon Sep 17 00:00:00 2001 From: Sir Darkrengarius Date: Mon, 8 Jul 2019 11:31:51 +0300 Subject: [PATCH] Remove unnecessary `listener != nil` check --- internal/therealssh/channel.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/therealssh/channel.go b/internal/therealssh/channel.go index 85882b8161..eafa235bf3 100644 --- a/internal/therealssh/channel.go +++ b/internal/therealssh/channel.go @@ -318,13 +318,7 @@ func (sshCh *SSHChannel) closeListener() error { sshCh.listenerMx.Lock() defer sshCh.listenerMx.Unlock() - if sshCh.listener != nil { - err := sshCh.listener.Close() - sshCh.listener = nil - return err - } - - return nil + return sshCh.listener.Close() } func debug(format string, v ...interface{}) {