Revert "fix: check client is not nil before closing"
This reverts commit 94285cd94d.
			
			
This commit is contained in:
		| @@ -408,13 +408,7 @@ func (q System) Command(user, cmd string) (output string, err error) { | ||||
| 		flog.Debug().Err(err).Msg("ssh connection") | ||||
| 		return | ||||
| 	} | ||||
| 	defer func() { | ||||
| 		if client != nil { | ||||
| 			client.Close() | ||||
| 		} else { | ||||
| 			log.Debug().Msg("why client is nil?") | ||||
| 		} | ||||
| 	}() | ||||
| 	defer client.Close() | ||||
|  | ||||
| 	session, err := client.NewSession() | ||||
| 	if err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user