Add DialWithOptions

DialWithOptions accept a variadic number of options, allowing to
introduce more options in the fure without breaking the API.
This commit is contained in:
Julien Laffaye
2019-04-10 20:25:16 +02:00
parent 55546487cf
commit 04b1878733
3 changed files with 126 additions and 44 deletions

View File

@@ -24,12 +24,7 @@ func TestConnEPSV(t *testing.T) {
func testConn(t *testing.T, disableEPSV bool) {
mock, c := openConn(t, "127.0.0.1")
if disableEPSV {
delete(c.features, "EPSV")
c.DisableEPSV = true
}
mock, c := openConn(t, "127.0.0.1", DialWithTimeout(5*time.Second), DialWithDisabledEPSV(disableEPSV))
err := c.Login("anonymous", "anonymous")
if err != nil {