Commit de25b12d authored by Andrzej Żeżel's avatar Andrzej Żeżel Committed by Ian Lance Taylor

bytes: add example for Len function of Reader

Change-Id: If7ecdc57f190f647bfc673bde8e66b4ef12aa906
Reviewed-on: https://go-review.googlesource.com/64190Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e7e4a4ff
......@@ -412,3 +412,13 @@ func ExampleToLower() {
fmt.Printf("%s", bytes.ToLower([]byte("Gopher")))
// Output: gopher
}
func ExampleReader_Len() {
fmt.Println(bytes.NewReader([]byte("")).Len())
fmt.Println(bytes.NewReader([]byte("Hi!")).Len())
fmt.Println(bytes.NewReader([]byte("Hello Gopher!")).Len())
// Output:
// 0
// 3
// 13
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment