Empty interface{} in function type
问题 An object of any type can be assigned to an empty interface. For example, we have the following function func Println(i interface{} ) { fmt.Println(i) } We can call it by Println(3) Println(1.5) Println("Hello") But I can't achieve the same thing for function type func Map(fn func( interface{} )) { ...... } I cannot call this with Map( func( i int) {......} ) because the type func(int) is different from the type func( interface{} ) . But when I define func( interface{} ) , I really mean any