Merge pull request #8363 from alrs/scripts-plugins-err-before-close

scripts: close file after error handling
pull/8365/head
Megan Marsh 7 years ago committed by GitHub
commit ffc4876812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -53,10 +53,10 @@ func main() {
// Write our generated code to the command/plugin.go file
file, err := os.Create(target)
defer file.Close()
if err != nil {
log.Fatalf("Failed to open %s for writing: %s", target, err)
}
defer file.Close()
_, err = file.WriteString(output)
if err != nil {

Loading…
Cancel
Save