summaryrefslogtreecommitdiff
path: root/repeat_test.go
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-10-26 11:59:23 -0600
committermo khan <mo.khan@gmail.com>2019-10-26 11:59:23 -0600
commit1e52b71575b694e370e46c2cc81f322db1b176c2 (patch)
tree3641ebe4472e165c2665bf2deb7d8e51ff806eb1 /repeat_test.go
parentd87ddbb288b7407179285c0f5193b3272027eea6 (diff)
Add Example usage of Repeat
Diffstat (limited to 'repeat_test.go')
-rw-r--r--repeat_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/repeat_test.go b/repeat_test.go
index ccb8d12..6c179ce 100644
--- a/repeat_test.go
+++ b/repeat_test.go
@@ -1,5 +1,6 @@
package main
+import "fmt"
import "testing"
func TestRepeat(t *testing.T) {
@@ -27,3 +28,8 @@ func BenchmarkRepeat(b *testing.B) {
Repeat("a", 5)
}
}
+
+func ExampleRepeat() {
+ fmt.Println(Repeat("x", 10))
+ // Output: xxxxxxxxxx
+}