diff options
| author | Spencer Tung <spencertung@google.com> | 2018-02-07 16:33:17 -0800 |
|---|---|---|
| committer | Han-Wen Nienhuys <hanwen@google.com> | 2018-02-19 16:34:59 +0000 |
| commit | 432090b8f568c018896cd8a0fb0345872bbac6ce (patch) | |
| tree | 62e89207736f912830a81a69ab0061d30f2e2240 /ssh/client_auth_test.go | |
| parent | 650f4a345ab4e5b245a3034b110ebc7299e68186 (diff) | |
| download | go-x-crypto-432090b8f568c018896cd8a0fb0345872bbac6ce.tar.xz | |
Adding a unique error when no authentication method has been passed in
yet.
Since ServerAuthError returns all errors collected during the
userAuthLoop, it will always include the generic error "no auth passed
yet" (assuming the connection fails).
Change-Id: I5f6c67f3f0762b023618178d4028600d2b6c9253
Reviewed-on: https://go-review.googlesource.com/92737
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'ssh/client_auth_test.go')
| -rw-r--r-- | ssh/client_auth_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ssh/client_auth_test.go b/ssh/client_auth_test.go index 145b57a..a6b8b99 100644 --- a/ssh/client_auth_test.go +++ b/ssh/client_auth_test.go @@ -614,8 +614,8 @@ func TestClientAuthErrorList(t *testing.T) { for i, e := range authErrs.Errors { switch i { case 0: - if e.Error() != "no auth passed yet" { - t.Fatalf("errors: got %v, want no auth passed yet", e.Error()) + if _, ok := e.(*NoAuthError); !ok { + t.Fatalf("errors: got error type %T, want NoAuthError", e) } case 1: if e != publicKeyErr { |
