route_info.go
func (ri *RouteInfo) Name(name string) *RouteInfo {
	routeIndex := -1
	for index, route := range ri.App.Routes() {
		if route.Path == ri.Path && route.Method == ri.Method {
			routeIndex = index
			break
		}
	}

	name = flect.Camelize(name)

	if !strings.HasSuffix(name, "Path") {
		name = name + "Path"
	}

	ri.PathName = name
	if routeIndex != -1 {
		ri.App.Routes()[routeIndex] = reflect.ValueOf(ri).Interface().(*RouteInfo)
	}

	return ri
}
func (ri *RouteInfo) Name(name string) *RouteInfo {
	routeIndex := -1
	for index, route := range ri.App.Routes() {
		if route.Path == ri.Path && route.Method == ri.Method {
			routeIndex = index
			break
		}
	}

	name = flect.Camelize(name)

	if !strings.HasSuffix(name, "Path") {
		name = name + "Path"
	}

	ri.PathName = name
	if routeIndex != -1 {
		ri.App.Routes()[routeIndex] = reflect.ValueOf(ri).Interface().(*RouteInfo)
	}

	return ri
}
func ( ri * RouteInfo ) Name ( name string ) * RouteInfo { routeIndex := - 1 for index , route := range ri . App . Routes ( ) { if route . Path == ri . Path && route . Method == ri . Method { routeIndex = index break } } name = flect . Camelize ( name ) if ! strings . HasSuffix ( name , " " ) { name = name + " " } ri . PathName = name if routeIndex != - 1 { ri . App . Routes ( ) [ routeIndex ] = reflect . ValueOf ( ri ) . Interface ( ) . ( * RouteInfo ) } return ri }
// Name allows users to set custom names for the routes.
Name allows users to set custom names for the routes .