From cb362c410118164e9c6f2db0e16d095525f9ef94 Mon Sep 17 00:00:00 2001 From: Davide D'Agostino Date: Thu, 4 May 2017 17:46:29 -0700 Subject: [PATCH] Rename connClosed -> closed --- client_test.go | 1 + ftp.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client_test.go b/client_test.go index 0409da0..8297e49 100644 --- a/client_test.go +++ b/client_test.go @@ -81,6 +81,7 @@ func testConn(t *testing.T, disableEPSV bool) { t.Errorf("'%s'", buf) } r.Close() + r.Close() // test we can close two times } // Read with deadline diff --git a/ftp.go b/ftp.go index 317002d..17fe35a 100644 --- a/ftp.go +++ b/ftp.go @@ -47,9 +47,9 @@ type Entry struct { // Response represents a data-connection type Response struct { - conn net.Conn - c *ServerConn - connClosed bool + conn net.Conn + c *ServerConn + closed bool } // Connect is an alias to Dial, for backward compatibility @@ -538,7 +538,7 @@ func (r *Response) Read(buf []byte) (int, error) { // Close implements the io.Closer interface on a FTP data connection. func (r *Response) Close() error { - if r.connClosed { + if r.closed { return nil } err := r.conn.Close() @@ -546,7 +546,7 @@ func (r *Response) Close() error { if err2 != nil { err = err2 } - r.connClosed = true + r.closed = true return err }