From ee4f266bab340535057631ecc572cf8fc3a577d8 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Fri, 8 May 2026 16:06:16 +0700 Subject: [PATCH] No longer call os.Exit from TestMain This is no longer necessary with Go 1.15 and above, cf. https://tip.golang.org/doc/go1.15#testingpkgtesting --- daemon/cluster_test.go | 3 +-- http/selection_test.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/daemon/cluster_test.go b/daemon/cluster_test.go index 37dcc6b2..92ee0a1d 100644 --- a/daemon/cluster_test.go +++ b/daemon/cluster_test.go @@ -5,7 +5,6 @@ package daemon import ( "fmt" - "os" "reflect" "sort" "testing" @@ -21,7 +20,7 @@ func TestMain(m *testing.M) { SetConfiguration(&Configuration{ RedisDB: 42, }) - os.Exit(m.Run()) + m.Run() } func TestStart(t *testing.T) { diff --git a/http/selection_test.go b/http/selection_test.go index 7fd5c649..ca981493 100644 --- a/http/selection_test.go +++ b/http/selection_test.go @@ -5,7 +5,6 @@ package http import ( "fmt" - "os" "testing" "time" @@ -24,7 +23,7 @@ func TestMain(m *testing.M) { SetConfiguration(&Configuration{ FixTimezoneOffsets: false, }) - os.Exit(m.Run()) + m.Run() } // Helper to check the results of the Filter function on a single mirror