RosettaCodeData/Task/Repeat/Go/repeat.go

18 lines
173 B
Go
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
package main
import "fmt"
func repeat(n int, f func()) {
for i := 0; i < n; i++ {
f()
}
}
func fn() {
fmt.Println("Example")
}
func main() {
repeat(4, fn)
}