Skip to content

Commit

Permalink
misc: clean up immediately and avoid delayed defer
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Oct 17, 2023
1 parent 30fcaa2 commit 0ed738d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/build/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ func (b *Builder) Diff() (string, bool, error) {
if err != nil {
return "", createdOrDrifted, err
}
defer cleanupDir(tmpDir)

err = diff(liveFile, mergedFile, &output)
if err != nil {
cleanupDir(tmpDir)
return "", createdOrDrifted, err
}

cleanupDir(tmpDir)
createdOrDrifted = true
}

Expand Down

0 comments on commit 0ed738d

Please sign in to comment.