From 0902a062c9998e7c1823513bcae0ab4c18465ea4 Mon Sep 17 00:00:00 2001 From: tauraamui Date: Thu, 6 Jul 2023 16:51:30 +0100 Subject: [PATCH] bugfix: prevent memory leak from tests --- storage/store_test.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/storage/store_test.go b/storage/store_test.go index f56e1e4..9c616b0 100644 --- a/storage/store_test.go +++ b/storage/store_test.go @@ -36,9 +36,7 @@ func TestStoreAndLoadMultipleBalloonsSuccess(t *testing.T) { defer db.Close() store := storage.New(db) - defer func() { - is.NoErr(store.Close()) - }() + defer store.Close() bigRedBalloon := Balloon{Color: "RED", Size: 695} smallYellowBalloon := Balloon{Color: "YELLOW", Size: 112} @@ -65,9 +63,7 @@ func TestStoreMultipleBalloonsSuccess(t *testing.T) { defer db.Close() store := storage.New(db) - defer func() { - is.NoErr(store.Close()) - }() + defer store.Close() bigRedBalloon := Balloon{Color: "RED", Size: 695} smallYellowBalloon := Balloon{Color: "YELLOW", Size: 112} @@ -89,9 +85,7 @@ func TestStoreMultipleBalloonsAndCakesInSuccessionRetainsCorrectRowIDs(t *testin defer db.Close() store := storage.New(db) - defer func() { - is.NoErr(store.Close()) - }() + defer store.Close() bigRedBalloon := Balloon{Color: "RED", Size: 695} disguistingVeganCake := Cake{Type: "INEDIBLE", Calories: -38}