Commit 22671e73 authored by Russ Cox's avatar Russ Cox

bytes: change ExampleReader_Len to use a non-ASCII string

This should help make clear that Len is not counting runes.
Also delete empty string, which doesn't add much.

Change-Id: I1602352df1897fef6e855e9db0bababb8ab788ca
Reviewed-on: https://go-review.googlesource.com/78110
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: 's avatarJoe Tsai <thebrokentoaster@gmail.com>
parent 04344266
......@@ -430,11 +430,9 @@ func ExampleToLower() {
}
func ExampleReader_Len() {
fmt.Println(bytes.NewReader([]byte("")).Len())
fmt.Println(bytes.NewReader([]byte("Hi!")).Len())
fmt.Println(bytes.NewReader([]byte("Hello Gopher!")).Len())
fmt.Println(bytes.NewReader([]byte("こんにちは!")).Len())
// Output:
// 0
// 3
// 13
// 16
}
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