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
7320b8d3c9
commit
5de2bea1b4
10
yq.go
10
yq.go
@ -46,12 +46,18 @@ func MoveFile(sourcePath, destPath string) error {
|
|||||||
}
|
}
|
||||||
outputFile, err := os.Create(destPath)
|
outputFile, err := os.Create(destPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
inputFile.Close()
|
err = inputFile.Close()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Failed close original file: %s", err)
|
||||||
|
}
|
||||||
return fmt.Errorf("couldn't open dest file: %s", err)
|
return fmt.Errorf("couldn't open dest file: %s", err)
|
||||||
}
|
}
|
||||||
defer outputFile.Close()
|
defer outputFile.Close()
|
||||||
_, err = io.Copy(outputFile, inputFile)
|
_, err = io.Copy(outputFile, inputFile)
|
||||||
inputFile.Close()
|
err = inputFile.Close()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Failed close original file: %s", err)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("writing to output file failed: %s", err)
|
return fmt.Errorf("writing to output file failed: %s", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user