Mark Connect() and DialWithTimeout() as deprecated

This commit is contained in:
Julien Laffaye 2022-08-18 12:44:22 -04:00
parent 5a2fd50da8
commit 4d1d644cf1
No known key found for this signature in database
GPG Key ID: 890C3E5C169AE841

5
ftp.go
View File

@ -308,14 +308,15 @@ func (o *dialOptions) wrapStream(rd io.ReadCloser) io.ReadCloser {
}
// Connect is an alias to Dial, for backward compatibility
//
// Deprecated: Use [Dial] instead
func Connect(addr string) (*ServerConn, error) {
return Dial(addr)
}
// DialTimeout initializes the connection to the specified ftp server address.
//
// It is generally followed by a call to Login() as most FTP commands require
// an authenticated user.
// Deprecated: Use [Dial] with [DialWithTimeout] option instead
func DialTimeout(addr string, timeout time.Duration) (*ServerConn, error) {
return Dial(addr, DialWithTimeout(timeout))
}