call_ellipse_func.go 213 B

12345678910111213141516
  1. package main
  2. type Any interface{}
  3. func main() {
  4. myFunc(func(x, y int, rest ...int) {
  5. println(x)
  6. println(y)
  7. println(rest)
  8. })
  9. }
  10. func myFunc(fn interface{}) {
  11. fn.(func(Any, Any, ...Any))(1, 2, 3, 4, 5)
  12. }