]> Cypherpunks repositories - gostls13.git/commitdiff
bytes: make ExampleTrimLeft and ExampleTrimRight match
authorRuss Cox <rsc@golang.org>
Tue, 14 Nov 2017 02:21:59 +0000 (21:21 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 15 Nov 2017 21:25:13 +0000 (21:25 +0000)
ExampleTrimLeft was inexplicably complex.

Change-Id: I13ca81bdeba728bdd632acf82e3a1101d29b9f39
Reviewed-on: https://go-review.googlesource.com/78111
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
src/bytes/example_test.go

index 9921a207b1df9184d91946909ecda2a2e4011832..00e39cadcbef6de21f1c952562d2d495cb311dbe 100644 (file)
@@ -383,9 +383,9 @@ func ExampleMap() {
 }
 
 func ExampleTrimLeft() {
-       fmt.Print(string(bytes.TrimLeft([]byte("+ 005400"), "+0 ")))
+       fmt.Print(string(bytes.TrimLeft([]byte("453gopher8257"), "0123456789")))
        // Output:
-       // 5400
+       // gopher8257
 }
 
 func ExampleTrimLeftFunc() {