From f1aced043cd306e85d25fb642858b88a0ea35622 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Wed, 13 Dec 2023 18:18:40 +0700 Subject: ssh/sftp: fix non-nil returned error on Close --- lib/ssh/sftp/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ssh/sftp/client.go b/lib/ssh/sftp/client.go index aec6751d..d8a66193 100644 --- a/lib/ssh/sftp/client.go +++ b/lib/ssh/sftp/client.go @@ -88,7 +88,10 @@ func (cl *Client) Close() (err error) { cl.pipeOut = nil cl.pipeIn = nil - return fmt.Errorf(`Close: %w`, err) + if err != nil { + return fmt.Errorf(`Close: %w`, err) + } + return nil } // CloseFile close the remote file handle. -- cgit v1.3