aboutsummaryrefslogtreecommitdiff
path: root/src/bytes/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytes/example_test.go')
-rw-r--r--src/bytes/example_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bytes/example_test.go b/src/bytes/example_test.go
index 4d5cdfa280..6d328378fa 100644
--- a/src/bytes/example_test.go
+++ b/src/bytes/example_test.go
@@ -298,6 +298,12 @@ func ExampleReplace() {
// moo moo moo
}
+func ExampleReplaceAll() {
+ fmt.Printf("%s\n", bytes.ReplaceAll([]byte("oink oink oink"), []byte("oink"), []byte("moo")))
+ // Output:
+ // moo moo moo
+}
+
func ExampleRunes() {
rs := bytes.Runes([]byte("go gopher"))
for _, r := range rs {