main.go
package main
import (
"log"
"reflect"
)
type Foo struct {}
func (this *Foo) DoSomething(param0 string, param1 int, param2 interface{}) {}
func main() {
foo := &Foo{}
methodType := reflect.ValueOf(foo.DoSomething).Type()
log.Printf("param0: %#v", methodType.In(0).String())
log.Printf("param1: %#v", methodType.In(1).String())
log.Printf("param2: %#v", methodType.In(2).String())
}
出力結果
2014/01/07 21:54:40 param0: "string"
2014/01/07 21:54:40 param1: "int"
2014/01/07 21:54:40 param2: "interface {}"