diff options
| author | Shulhan <ms@kilabit.info> | 2023-12-13 18:18:40 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-12-13 18:18:40 +0700 |
| commit | f1aced043cd306e85d25fb642858b88a0ea35622 (patch) | |
| tree | 6cc4bd01fc99e58420c6e0c31826e6997d63c7af | |
| parent | 07986c5582d9e7255630eaaab5b4f1d3c1c23592 (diff) | |
| download | pakakeh.go-f1aced043cd306e85d25fb642858b88a0ea35622.tar.xz | |
ssh/sftp: fix non-nil returned error on Close
| -rw-r--r-- | lib/ssh/sftp/client.go | 5 |
1 files changed, 4 insertions, 1 deletions
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. |
