mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
fix linter error
This commit is contained in:
parent
7a28531f2f
commit
a9c0ef571c
12
yq.go
12
yq.go
@ -46,18 +46,12 @@ func MoveFile(sourcePath, destPath string) error {
|
||||
}
|
||||
outputFile, err := os.Create(destPath)
|
||||
if err != nil {
|
||||
err = inputFile.Close()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed close original file: %s", err)
|
||||
}
|
||||
defer safelyCloseFile(inputFile)
|
||||
return fmt.Errorf("couldn't open dest file: %s", err)
|
||||
}
|
||||
defer outputFile.Close()
|
||||
defer safelyCloseFile(outputFile)
|
||||
_, err = io.Copy(outputFile, inputFile)
|
||||
err = inputFile.Close()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed close original file: %s", err)
|
||||
}
|
||||
defer safelyCloseFile(inputFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("writing to output file failed: %s", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user