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 <hidde@hhh.computer>
  • Loading branch information
hiddeco committed Oct 13, 2023
1 parent 26221ea commit ffcc2b6
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 ffcc2b6

Please sign in to comment.