Fix errors in example code
This commit is contained in:
parent
52d3001130
commit
75b9ebed79
10
README.md
10
README.md
@ -16,19 +16,19 @@ go get -u github.com/jlaffaye/ftp
|
|||||||
## Example ##
|
## Example ##
|
||||||
|
|
||||||
```go
|
```go
|
||||||
c, err := ftp.DialWithOptions("ftp.example.org", DialWithTimeout(5*time.Second))
|
c, err := ftp.DialWithOptions("ftp.example.org:21", ftp.DialWithTimeout(5*time.Second))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = c.Login("anonymous", "anonymous")
|
err = c.Login("anonymous", "anonymous")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do something with the FTP conn
|
// Do something with the FTP conn
|
||||||
|
|
||||||
if err := c.Close(); err != nil {
|
if err := c.Quit(); err != nil {
|
||||||
t.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user