I have one struct with 2 methods under struct definition, I want to call in other place that use struct's name and method's name as param.
Struct code as following:
type ArticleForm struct {
Name string `required:"true" pattern:"^[A-Za-z0-9\u4e00-\u9fa5]{1,1024}$" valid:"Required;MaxSize(1024)"`
Category []Category `class:"multis" required:"true" valid:"Required" optionqs:"GetCategoryOption"`
Content string `class:"wysiwg_area" required:"true" valid:"Required"`
Tags []Tags `class:"multis_create" optionqs:"GetTagOptions"`
}
Method definition as following:
func (this *ArticleForm) GetTagOptions() []Tags {
return GetTagsOptions(nil)
}
Following is what I want to call:
func main() {
s := "models.ArticleForm"
t := "GetTagOptions"
//following is the question, how can i exec following?
funcall(s,t)
}
How to fulfill the funcall(s,t)
?