mirror of
https://github.com/golang/go
synced 2024-11-19 20:54:39 -07:00
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: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
0434426686
commit
22671e7344
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user