Skip to content

Commit

Permalink
Cleanup instead of defer in beego test
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Feb 8, 2023
1 parent 98ebd98 commit f5bf363
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func TestRender(t *testing.T) {
// Create the view
file, err := os.CreateTemp(dir, "*index.tpl")
require.NoError(t, err)
defer file.Close()
t.Cleanup(func() { require.NoError(t, file.Close()) })
_, err = file.WriteString(htmlStr)
require.NoError(t, err)
// Add path to view path
Expand Down

0 comments on commit f5bf363

Please sign in to comment.