PHP » GoLang |
login |
register |
about
|
method_existsmethod_exists[code] func MethodExists(obj interface{}, method string) bool { valueOf := reflect.ValueOf(obj) methodVal := valueOf.MethodByName(method) return methodVal.IsValid() } [/code] |