Skip to content

Commit 184a689

Browse files
committed
ssh: remove testing.T from ExampleRetryableAuthMethod
Change-Id: I9cb821827b16d60b0a8c4fff9caec78748f3a495 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/171677 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 457ee04 commit 184a689

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ssh/client_auth_test.go

+13-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
"errors"
1111
"fmt"
1212
"io"
13+
"log"
14+
"net"
1315
"os"
1416
"strings"
1517
"testing"
@@ -477,7 +479,7 @@ func TestRetryableAuth(t *testing.T) {
477479
}
478480
}
479481

480-
func ExampleRetryableAuthMethod(t *testing.T) {
482+
func ExampleRetryableAuthMethod() {
481483
user := "testuser"
482484
NumberOfPrompts := 3
483485

@@ -495,9 +497,17 @@ func ExampleRetryableAuthMethod(t *testing.T) {
495497
},
496498
}
497499

498-
if err := tryAuth(t, config); err != nil {
499-
t.Fatalf("unable to dial remote side: %s", err)
500+
host := "mysshserver"
501+
netConn, err := net.Dial("tcp", host)
502+
if err != nil {
503+
log.Fatal(err)
504+
}
505+
506+
sshConn, _, _, err := NewClientConn(netConn, host, config)
507+
if err != nil {
508+
log.Fatal(err)
500509
}
510+
_ = sshConn
501511
}
502512

503513
// Test if username is received on server side when NoClientAuth is used

0 commit comments

Comments
 (0)