From 690488dac92075546a3af26ef902a06c79d40ed9 Mon Sep 17 00:00:00 2001 From: Daniel Mai Date: Thu, 5 Dec 2019 23:05:06 -0800 Subject: [PATCH] Fix removeDir function in tests. (#1145) All the usages of removeDir only called the function itself and not the returned func. This change does away with the returned func, so calling removeDir will remove the badger directories during the test. --- db_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/db_test.go b/db_test.go index f285aa097..82f4027df 100644 --- a/db_test.go +++ b/db_test.go @@ -2025,11 +2025,9 @@ func ExampleDB_Subscribe() { // a-key is now set to a-value } -func removeDir(dir string) func() { - return func() { - if err := os.RemoveAll(dir); err != nil { - panic(err) - } +func removeDir(dir string) { + if err := os.RemoveAll(dir); err != nil { + panic(err) } }