iteration: add example for Repeat function

This commit is contained in:
vinchent 2024-09-10 13:30:09 +02:00
parent de5d9f39b6
commit 2684521bdd

View File

@ -1,6 +1,15 @@
package iteration package iteration
import "testing" import (
"fmt"
"testing"
)
func ExampleRepeat() {
repeated := Repeat("ab")
fmt.Println(repeated)
// Output: ababababab
}
func TestRepeat(t *testing.T) { func TestRepeat(t *testing.T) {
repeated := Repeat("a") repeated := Repeat("a")