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 /cmd/gitaly-ssh | |
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 'cmd/gitaly-ssh')
-rw-r--r-- | cmd/gitaly-ssh/auth_test.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd/gitaly-ssh/auth_test.go b/cmd/gitaly-ssh/auth_test.go index b0e84456a..cc3b9fd29 100644 --- a/cmd/gitaly-ssh/auth_test.go +++ b/cmd/gitaly-ssh/auth_test.go @@ -97,8 +97,7 @@ func TestConnectivity(t *testing.T) { addr: func(t *testing.T, cfg config.Cfg) (string, string) { certFile, keyFile := testhelper.GenerateCerts(t) - revertEnv := testhelper.ModifyEnvironment(t, x509.SSLCertFile, certFile) - t.Cleanup(revertEnv) + testhelper.ModifyEnvironment(t, x509.SSLCertFile, certFile) cfg.TLSListenAddr = "localhost:0" cfg.TLS = config.TLS{ |