From bd6dabb4ebbeb489de5b4bbe2284cd57142880e9 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Wed, 8 Feb 2023 10:13:10 -0800 Subject: [PATCH] Cleanup instead of defer in beego test --- .../github.com/astaxie/beego/otelbeego/test/beego_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go b/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go index b0a8684da12..8e5a570e035 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go @@ -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() { file.Close() }) _, err = file.WriteString(htmlStr) require.NoError(t, err) // Add path to view path