Change-Id: Ic0a97fd7bb89865448e436e5c092415a29d8badf
Reviewed-on: https://go-review.googlesource.com/c/go/+/352009
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: David Chase <drchase@google.com>
// Output: 5
}
+func ExampleBuffer_Next() {
+ var b bytes.Buffer
+ b.Grow(64)
+ b.Write([]byte("abcde"))
+ fmt.Printf("%s\n", string(b.Next(2)))
+ fmt.Printf("%s\n", string(b.Next(2)))
+ fmt.Printf("%s", string(b.Next(2)))
+ // Output:
+ // ab
+ // cd
+ // e
+}
+
func ExampleCompare() {
// Interpret Compare's result by comparing it to zero.
var a, b []byte