diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2021-03-17 21:18:42 +0300 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2021-03-17 21:23:07 +0300 |
commit | ee41d0dfb7b02a19f5926bfe24dbad1df417a29e (patch) | |
tree | 130f2777342645018f3f6b797ee0083d65910889 /client/client_test.go | |
parent | 4b40a2cb8c71a5b490cad4c8e1ad2dc0e9b39548 (diff) | |
download | gitlab-shell-ee41d0dfb7b02a19f5926bfe24dbad1df417a29e.tar.gz |
Replace cleanup functions with t.Cleanup
In this case we don't need to propagate cleanup
function. It simplifies the code.
Diffstat (limited to 'client/client_test.go')
-rw-r--r-- | client/client_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/client/client_test.go b/client/client_test.go index fec51c5..90cd499 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -26,7 +26,7 @@ func TestClients(t *testing.T) { desc string relativeURLRoot string caFile string - server func(*testing.T, []testserver.TestRequestHandler) (string, func()) + server func(*testing.T, []testserver.TestRequestHandler) string }{ { desc: "Socket client", @@ -49,7 +49,7 @@ func TestClients(t *testing.T) { { desc: "Https client", caFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt"), - server: func(t *testing.T, handlers []testserver.TestRequestHandler) (string, func()) { + server: func(t *testing.T, handlers []testserver.TestRequestHandler) string { return testserver.StartHttpsServer(t, handlers, "") }, }, @@ -57,8 +57,7 @@ func TestClients(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - url, cleanup := tc.server(t, buildRequests(t, tc.relativeURLRoot)) - defer cleanup() + url := tc.server(t, buildRequests(t, tc.relativeURLRoot)) secret := "sssh, it's a secret" |