mirror of
https://github.com/jkaninda/go-storage.git
synced 2025-12-08 09:39:39 +01:00
refactor: refactoring of code to meet all go lint requirements
This commit is contained in:
@@ -116,7 +116,12 @@ func copyFile(src, dst string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer in.Close()
|
||||
defer func(in *os.File) {
|
||||
err := in.Close()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}(in)
|
||||
|
||||
out, err := os.Create(dst)
|
||||
if err != nil {
|
||||
@@ -125,7 +130,10 @@ func copyFile(src, dst string) error {
|
||||
|
||||
_, err = io.Copy(out, in)
|
||||
if err != nil {
|
||||
out.Close()
|
||||
err := out.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
return out.Close()
|
||||
|
||||
Reference in New Issue
Block a user