Skip to content

Commit

Permalink
README.md: Don't print excess characters in example
Browse files Browse the repository at this point in the history
  • Loading branch information
nlsun authored Oct 29, 2021
1 parent 4871aa0 commit 02a2e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ batch := conn.ReadBatch(10e3, 1e6) // fetch 10KB min, 1MB max

b := make([]byte, 10e3) // 10KB max per message
for {
_, err := batch.Read(b)
n, err := batch.Read(b)
if err != nil {
break
}
fmt.Println(string(b))
fmt.Println(string(b[:n]))
}

if err := batch.Close(); err != nil {
Expand Down

0 comments on commit 02a2e42

Please sign in to comment.