Пример #1
0
func (this *RouteAdapter) checkMethod(runMethod string) (router *routeMapping, verifi bool) {
	value := reflect.ValueOf(this.Route)
	reflect := reflect.Indirect(value).Type()
	if funcName := value.MethodByName(runMethod); funcName.IsValid() {
		return &routeMapping{
			reflect:   reflect,
			runMethod: runMethod,
			pattern:   this.Pattern,
		}, true
	} else {
		log.E("'%s' method doesn't exist in the router %s", nil, runMethod, reflect.Name())
		return nil, false
	}
}
Пример #2
0
func Name(t reflect.Type, pkgPath, name string) reflect.Type {
	return reflect.Name(t, pkgPath, name)
}