mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 07:28:06 +00:00
Fix lint errors
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package system
|
package system
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@@ -64,14 +65,24 @@ func ReplaceFile(src, dst string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer sourceFile.Close()
|
defer func(sourceFile *os.File) {
|
||||||
|
cerr := sourceFile.Close()
|
||||||
|
if err != nil {
|
||||||
|
err = errors.Join(err, cerr)
|
||||||
|
}
|
||||||
|
}(sourceFile)
|
||||||
|
|
||||||
// Create (or overwrite) the destination file
|
// Create (or overwrite) the destination file
|
||||||
destFile, err := os.Create(filepath.Join(rootDir, dst))
|
destFile, err := os.Create(filepath.Join(rootDir, dst))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer destFile.Close()
|
defer func(destFile *os.File) {
|
||||||
|
cerr := destFile.Close()
|
||||||
|
if err != nil {
|
||||||
|
err = errors.Join(err, cerr)
|
||||||
|
}
|
||||||
|
}(destFile)
|
||||||
|
|
||||||
// Copy contents
|
// Copy contents
|
||||||
if _, err = io.Copy(destFile, sourceFile); err != nil {
|
if _, err = io.Copy(destFile, sourceFile); err != nil {
|
||||||
|
Reference in New Issue
Block a user