From 8f079cd78f51a8539da160f83a0face8d3db5f9d Mon Sep 17 00:00:00 2001 From: Thomas Hipp Date: Mon, 16 Dec 2024 12:11:11 +0100 Subject: [PATCH] Satisfy linters --- pkg/routine/routine_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/routine/routine_test.go b/pkg/routine/routine_test.go index 788aef69a..29ac0178d 100644 --- a/pkg/routine/routine_test.go +++ b/pkg/routine/routine_test.go @@ -17,7 +17,7 @@ import ( "github.com/pace/bricks/http/security" "github.com/pace/bricks/locale" "github.com/pace/bricks/maintenance/log" - . "github.com/pace/bricks/pkg/routine" + "github.com/pace/bricks/pkg/routine" ) func TestRun_catchesPanics(t *testing.T) { @@ -90,7 +90,7 @@ func testRunBlocksAfterShutdown(t *testing.T) { // start routine that gets canceled by the shutdown routineCtx := make(chan context.Context) - Run(context.Background(), func(ctx context.Context) { + routine.Run(context.Background(), func(ctx context.Context) { routineCtx <- ctx endOfTest.Wait() }) @@ -141,7 +141,7 @@ func testRunCancelsContextsOn(t *testing.T, signum syscall.Signal) { routinesStarted.Add(len(routineContexts)) for i := range routineContexts { i := i - Run(context.Background(), func(ctx context.Context) { + routine.Run(context.Background(), func(ctx context.Context) { routineContexts[i] = ctx routinesStarted.Done() endOfTest.Wait() @@ -176,11 +176,11 @@ func exitAfterTest(t *testing.T, name string, testFunc func(*testing.T)) { } // Calls Run and returns once the routine is finished. -func waitForRun(ctx context.Context, routine func(context.Context)) { +func waitForRun(ctx context.Context, fn func(context.Context)) { done := make(chan struct{}) - Run(ctx, func(ctx context.Context) { + routine.Run(ctx, func(ctx context.Context) { defer func() { done <- struct{}{} }() - routine(ctx) + fn(ctx) }) <-done }