Skip to content

Commit

Permalink
fix: close output file
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Apr 12, 2024
1 parent e2f7fe8 commit c074663
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/describezones/main.go
Expand Up @@ -165,7 +165,8 @@ func writeOutput(provider string, input []byte) {
if err != nil {
log.Fatalf("could not create output file: %s", err)
}

defer f.Close()

Check failure on line 169 in tools/describezones/main.go

View workflow job for this annotation

GitHub Actions / Build

File is not `gofmt`-ed with `-s` (gofmt)
formatted, err := format.Source(input)
if err != nil {
log.Fatalf("could not format output: %s", err)

Check failure on line 172 in tools/describezones/main.go

View workflow job for this annotation

GitHub Actions / Build

exitAfterDefer: log.Fatalf will exit, and `defer f.Close()` will not run (gocritic)
Expand Down

0 comments on commit c074663

Please sign in to comment.