From ee41d0dfb7b02a19f5926bfe24dbad1df417a29e Mon Sep 17 00:00:00 2001 From: Igor Drozdov Date: Wed, 17 Mar 2021 21:18:42 +0300 Subject: Replace cleanup functions with t.Cleanup In this case we don't need to propagate cleanup function. It simplifies the code. --- internal/command/uploadpack/gitalycall_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'internal/command/uploadpack/gitalycall_test.go') diff --git a/internal/command/uploadpack/gitalycall_test.go b/internal/command/uploadpack/gitalycall_test.go index e94a628..d945764 100644 --- a/internal/command/uploadpack/gitalycall_test.go +++ b/internal/command/uploadpack/gitalycall_test.go @@ -17,12 +17,10 @@ import ( ) func TestUploadPack(t *testing.T) { - gitalyAddress, testServer, cleanup := testserver.StartGitalyServer(t) - defer cleanup() + gitalyAddress, testServer := testserver.StartGitalyServer(t) requests := requesthandlers.BuildAllowedWithGitalyHandlers(t, gitalyAddress) - url, cleanup := testserver.StartHttpServer(t, requests) - defer cleanup() + url := testserver.StartHttpServer(t, requests) output := &bytes.Buffer{} input := &bytes.Buffer{} @@ -42,7 +40,7 @@ func TestUploadPack(t *testing.T) { require.NoError(t, err) require.Equal(t, "UploadPack: "+repo, output.String()) - require.Eventually(t, func() bool{ + require.Eventually(t, func() bool { entries := hook.AllEntries() require.Equal(t, 2, len(entries)) -- cgit v1.2.1