From 22671e734473d3cd088958a00826c1adf936032c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 13 Nov 2017 21:20:23 -0500 Subject: [PATCH] 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 Reviewed-by: Joe Tsai --- src/bytes/example_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bytes/example_test.go b/src/bytes/example_test.go index 6a7ce59f55..9921a207b1 100644 --- a/src/bytes/example_test.go +++ b/src/bytes/example_test.go @@ -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 }