mirror of
https://github.com/jkaninda/go-storage.git
synced 2025-12-06 08:39:39 +01:00
refactor: refactoring of code to meet all go lint requirements
This commit is contained in:
@@ -121,7 +121,12 @@ func (s sshStorage) CopyFrom(fileName string) error {
|
||||
if err != nil {
|
||||
return errors.New("couldn't open the output file")
|
||||
}
|
||||
defer file.Close()
|
||||
defer func(file *os.File) {
|
||||
err := file.Close()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}(file)
|
||||
|
||||
err = client.CopyFromRemote(context.Background(), file, filepath.Join(s.RemotePath, fileName))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user