diff options
author | Toon Claes <toon@gitlab.com> | 2022-01-17 15:58:16 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2022-01-17 15:58:16 +0300 |
commit | cf4cff104abd2b41f2fc04d69aba8b00cfbdb650 (patch) | |
tree | 9c0e9cfecb04e85a2f43ee58ef5fbc03c8e57cd1 /client | |
parent | 7ce0d18ad44686865aa0dbf5f1b47d9cc05988be (diff) |
testhelper: ModifyEnvironment cleans after itself
Prior to this change, ModifyEnvironment was returning a function to
revert the changes done. This was typically passed to defer or to
t.Cleanup().
This change moves calling t.Cleanup() to the ModifyEnvironment function
itself.
Diffstat (limited to 'client')
-rw-r--r-- | client/dial_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/dial_test.go b/client/dial_test.go index 0652fffbe..9a0f9f660 100644 --- a/client/dial_test.go +++ b/client/dial_test.go @@ -128,7 +128,7 @@ func TestDial(t *testing.T) { } if tt.envSSLCertFile != "" { - defer testhelper.ModifyEnvironment(t, gitalyx509.SSLCertFile, tt.envSSLCertFile)() + testhelper.ModifyEnvironment(t, gitalyx509.SSLCertFile, tt.envSSLCertFile) } ctx, cancel := testhelper.Context() @@ -218,7 +218,7 @@ func TestDialSidechannel(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if tt.envSSLCertFile != "" { - defer testhelper.ModifyEnvironment(t, gitalyx509.SSLCertFile, tt.envSSLCertFile)() + testhelper.ModifyEnvironment(t, gitalyx509.SSLCertFile, tt.envSSLCertFile) } ctx, cancel := testhelper.Context() |