Skip to content

Commit 02a2e42

Browse files
authored
README.md: Don't print excess characters in example
1 parent 4871aa0 commit 02a2e42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ batch := conn.ReadBatch(10e3, 1e6) // fetch 10KB min, 1MB max
118118

119119
b := make([]byte, 10e3) // 10KB max per message
120120
for {
121-
_, err := batch.Read(b)
121+
n, err := batch.Read(b)
122122
if err != nil {
123123
break
124124
}
125-
fmt.Println(string(b))
125+
fmt.Println(string(b[:n]))
126126
}
127127

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

0 commit comments

Comments
 (0)