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 ##
|
||||
|
||||
```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 {
|
||||
t.Fatal(err)
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
err = c.Login("anonymous", "anonymous")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Do something with the FTP conn
|
||||
|
||||
if err := c.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
if err := c.Quit(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user