Skip to content

Commit

Permalink
Improve readme (jlaffaye#154)
Browse files Browse the repository at this point in the history
Improved the README.md file to include an example of storing and reading a file.
  • Loading branch information
mrbenosborne authored and jlaffaye committed Jul 18, 2019
1 parent c1312a7 commit 9bf9e00
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,25 @@ if err := c.Quit(); err != nil {
log.Fatal(err)
}
```

## Store a file example ##

```go
data := bytes.NewBufferString("Hello World")
err = c.Stor("test-file.txt", data)
if err != nil {
panic(err)
}
```

## Read a file example ##

```go
r, err := c.Retr("test-file.txt")
if err != nil {
panic(err)
}

buf, err := ioutil.ReadAll(r)
println(string(buf))
```

0 comments on commit 9bf9e00

Please sign in to comment.