Hello fellow gophers.

Given a function type: type Fun func()

And two structure methods that satisfy the function type:

type Alpha struct {
}
func (a Alpha) funA() {
}

type Beta struct {
}
func (b Beta) funB() {
}

At runtime, is there a way to tell whether a non-nil `var f Fun` is 
assigned to an arbitrary instance of structure Alpha, or Beta? Can 
reflection help in this case?

Thanks!

Kind regards,
Howard

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ae48fbd4-591a-4930-baee-7d861645d59b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to