From fa8ecd9a332e0bd4a2248c4f64f856f7e4c4cce3 Mon Sep 17 00:00:00 2001 From: TieWay59 Date: Sat, 11 Mar 2023 20:37:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E8=A1=A5=E9=BD=90=20`connect`=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E7=BC=BA=E5=A4=B1=E7=9A=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 采用 nil 作为 `keyExchangeList` 从而提供默认的行为 --- funcs/ssh_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/funcs/ssh_test.go b/funcs/ssh_test.go index 0ff1d7e..478d8b0 100644 --- a/funcs/ssh_test.go +++ b/funcs/ssh_test.go @@ -18,7 +18,7 @@ const ( func Test_SSH(t *testing.T) { var cipherList []string - session, err := connect(username, password, ip, key, port, cipherList) + session, err := connect(username, password, ip, key, port, cipherList, nil) if err != nil { t.Error(err) return From cfc416503f562b4e1a38f15cf961f80fe5c5cd50 Mon Sep 17 00:00:00 2001 From: TieWay59 Date: Sat, 11 Mar 2023 20:43:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?doc:=20=E5=A2=9E=E5=8A=A0=20`Test=5FSSH`=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funcs/ssh_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/funcs/ssh_test.go b/funcs/ssh_test.go index 478d8b0..5dc124a 100644 --- a/funcs/ssh_test.go +++ b/funcs/ssh_test.go @@ -16,6 +16,10 @@ const ( key = "../server.key" ) +// Tests the SSH functionality of the package. +// +// It requires manual input of the local SSH private key path into the key +// variable, and the remote address into the ip variable. func Test_SSH(t *testing.T) { var cipherList []string session, err := connect(username, password, ip, key, port, cipherList, nil)