gf/geg/other/test.go
2017-12-26 11:46:48 +08:00

24 lines
296 B
Go

package main
import (
"fmt"
"reflect"
)
type Test struct {
name string
}
func (t *Test) Show(s string) {
fmt.Println(t.name)
fmt.Println(s)
}
type F func(string)
func main() {
t := &Test{}
t.name = "john"
reflect.ValueOf(t).Method(0).Interface().(F)("123")
}