Skip to content

Commit

Permalink
fix: Properly close created files (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
beatbrot authored Jan 20, 2024
1 parent 8449ab0 commit 3eaadca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/config/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ func create(file string) error {
return err
}
}
_, err := os.Create(file)
f, err := os.Create(file)
defer func() { _ = f.Close() }()

return err
}

0 comments on commit 3eaadca

Please sign in to comment.