go-examples/go-hello/main.go
2017-07-07 14:29:36 +02:00

13 lines
200 B
Go

package main
import "fmt"
func visit(nums []int, callback func(...interface{}) (int, error)) {
for _, n := range nums {
callback(n)
}
}
func main() {
visit([]int{1, 2, 3, 4, 5}, fmt.Println)
}