package main
import "fmt"
import "reflect"
func MyMissionMethod(a string){
fmt.Println("hello, world, this is my mission.")
fmt.Printf("and this is my params: %s \n", a)
}
func CallMethod(method interface{}){
// here method is a interface which is a type of func
fv := reflect.ValueOf(method)
args := []reflect.Value{reflect.ValueOf("金天")}
fv.Call(args)
}
func main() {
mission := MyMissionMethod
CallMethod(mission)
}
好了,就讲到这里吧,下一次blog讲解golang里面的多线程。