From 5bde4b92a24c57c15fa14423b9f083e5dd831477 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 29 May 2024 19:35:42 +0200 Subject: [PATCH] fix test cases Signed-off-by: Nicola Murino --- internal/sftpd/sftpd_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/sftpd/sftpd_test.go b/internal/sftpd/sftpd_test.go index 59c2fdfc..9279b4a7 100644 --- a/internal/sftpd/sftpd_test.go +++ b/internal/sftpd/sftpd_test.go @@ -1197,9 +1197,9 @@ func TestProxyProtocol(t *testing.T) { assert.NoError(t, checkBasicSFTP(client)) } conn, client, err = getSftpClientWithAddr(user, usePubKey, "127.0.0.1:2224") - if !assert.Error(t, err) { - client.Close() - conn.Close() + if assert.NoError(t, err) { + defer client.Close() + defer conn.Close() } _, err = httpdtest.RemoveUser(user, http.StatusOK) assert.NoError(t, err)