INNER CODE UNIT · Go
func
GoAdminGroup/go-admin · context/context.go:51
func (r RouterMap) Get(name string) Router {
return r[name]
}
type Router struct {
Methods []string
Patten string
}
func (r Router) Method() string {
return r.Methods[0]
}
func (r Router) GetURL(value ...string) string {
u := r.Patten
for i := 0; i < len(value); i += 2 {
u = strings.ReplaceAll(u, ":__"+value[i], value[i+1])
}