package iteration import ( "fmt" "testing" ) func TestRepeat(t *testing.T) { repeated := Repeat("a", 3) expected := "aaa" if repeated != expected { t.Errorf("expected %q got %q", expected, repeated) } } func BenchmarkRepeat(b *testing.B) { for i := 0; i < b.N; i++ { Repeat("a", 5) } } func ExampleRepeat() { res := Repeat("a", 5) fmt.Println(res) // Output: aaaaa }