From 42816845286ce0c529faf02f0906f6c565446f9d Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sun, 13 Nov 2022 15:38:02 -0800 Subject: [PATCH] Fix confused defer --- client/client_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index 5f29311..dbf2229 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -32,9 +32,9 @@ func skipSlowTests() bool { var initialWd string func TestMain(m *testing.M) { - defer testutils.BackupAndRestoreEnv("HISHTORY_TEST") + defer testutils.BackupAndRestoreEnv("HISHTORY_TEST")() os.Setenv("HISHTORY_TEST", "1") - defer testutils.BackupAndRestoreEnv("HISHTORY_SKIP_INIT_IMPORT") + defer testutils.BackupAndRestoreEnv("HISHTORY_SKIP_INIT_IMPORT")() os.Setenv("HISHTORY_SKIP_INIT_IMPORT", "1") defer testutils.RunTestServer()() cmd := exec.Command("go", "build", "-o", "/tmp/client") @@ -1479,7 +1479,7 @@ func testHishtoryOffline(t *testing.T, tester shellTester) { func testInitialHistoryImport(t *testing.T, tester shellTester) { // Setup defer testutils.BackupAndRestore(t)() - defer testutils.BackupAndRestoreEnv("HISHTORY_SKIP_INIT_IMPORT") + defer testutils.BackupAndRestoreEnv("HISHTORY_SKIP_INIT_IMPORT")() os.Setenv("HISHTORY_SKIP_INIT_IMPORT", "") // Record some commands before installing hishtory