From 519b3662232f25c77a17299bb454dff4d7f7c9c7 Mon Sep 17 00:00:00 2001 From: Julien Laffaye Date: Wed, 19 Aug 2015 00:17:44 +0200 Subject: [PATCH] Silence StatusNotImplemented error for Logout() --- client_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client_test.go b/client_test.go index 57095b3..b383ddf 100644 --- a/client_test.go +++ b/client_test.go @@ -3,6 +3,7 @@ package ftp import ( "bytes" "io/ioutil" + "net/textproto" "testing" "time" ) @@ -110,7 +111,13 @@ func TestConn(t *testing.T) { err = c.Logout() if err != nil { - t.Error(err) + if protoErr := err.(*textproto.Error); protoErr != nil { + if protoErr.Code != StatusNotImplemented { + t.Error(err) + } + } else { + t.Error(err) + } } c.Quit()