Try this:

https://play.golang.org/p/zJa8N24nxi

--

package main

import (
"fmt"
"log"
"reflect"
)

func main() {
var controller interface{} = Test.IsWorking
funcTyp := reflect.TypeOf(controller)
structTyp := funcTyp.In(0)
newValue := reflect.New(structTyp).Interface()
fmt.Printf("%#+v", newValue)
}

type Test struct {
Name string
}

func (t Test) IsWorking() {
log.Println("hello")
}

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to