refactor: refactoring of code to meet all go lint requirements

This commit is contained in:
Jonas Kaninda committed 2024-12-06 16:25:16 +01:00
1 parent 2bcfd3aacf
commit 793b04340e
10 files changed
+141 -17

No files matched your search

+6 -1
View File
@@ -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))