package sshd import ( "fmt" "testing" "time" ) func TestSSH(t *testing.T) { myssh := new(StarSSH) err := myssh.Connect("root", "", "9sday.me", "c:\\id_rsa", 22) if err != nil { t.Fatalf("%e", err) } shell, err := myssh.NewShell() if err != nil { t.Fatalf("%e", err) } shell.isprint = true time.Sleep(5 * time.Second) a, b, err := shell.ShellClear("apt update\n", 20000) fmt.Println(a, b, err) }