aboutsummaryrefslogtreecommitdiff
path: root/src/bytes/example_test.go
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2018-09-06 13:25:27 -0400
committerFilippo Valsorda <filippo@golang.org>2018-09-06 13:25:27 -0400
commit4d1aa482b8754c081d8f3f6b39fe61dd2e6504fc (patch)
treeb12a76ad02035d1206d09a7aa14a6cda0c411c3c /src/bytes/example_test.go
parent7eb1677c01c3decc510270d532ed69d0bf42bffa (diff)
parent3e5b5d69dcdb82494f550049986426d84dd6b8f8 (diff)
downloadgo-4d1aa482b8754c081d8f3f6b39fe61dd2e6504fc.tar.xz
[dev.boringcrypto] all: merge master into dev.boringcrypto
Change-Id: Ia8ddd4e52dcfe87f9daef2edd37c8155fcae7f5a
Diffstat (limited to 'src/bytes/example_test.go')
-rw-r--r--src/bytes/example_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bytes/example_test.go b/src/bytes/example_test.go
index 5b7a46058f..4d5cdfa280 100644
--- a/src/bytes/example_test.go
+++ b/src/bytes/example_test.go
@@ -39,6 +39,14 @@ func ExampleBuffer_Grow() {
// Output: "64 bytes or fewer"
}
+func ExampleBuffer_Len() {
+ var b bytes.Buffer
+ b.Grow(64)
+ b.Write([]byte("abcde"))
+ fmt.Printf("%d", b.Len())
+ // Output: 5
+}
+
func ExampleCompare() {
// Interpret Compare's result by comparing it to zero.
var a, b []byte