Skip to content

Instantly share code, notes, and snippets.

@liuzhe0223
Created April 24, 2014 02:44
Show Gist options
  • Save liuzhe0223/11239710 to your computer and use it in GitHub Desktop.
Save liuzhe0223/11239710 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"reflect"
)
type A struct {
}
func (a *A) Hello() {
fmt.Println("hello")
}
func main() {
a := new(A)
v := reflect.ValueOf(a).MethodByName("Hello")
in := make([]reflect.Value, 0, 0)
v.Call(in)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment