scripts: close file after error handling

pull/8363/head
Lars Lehtonen 7 years ago
parent 9afb7b54cb
commit 3c170522f3
No known key found for this signature in database
GPG Key ID: 8137D474EBCB04F2

@ -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