Chore: pass url parameters through context.Context (#38826)
* pass url parameters through context.Context * fix url param names without colon prefix * change context params to vars * replace url vars in tests using new api * rename vars to params * add some comments * rename seturlvars to seturlparams
This commit is contained in:
@@ -219,7 +219,7 @@ func URL(obj interface{}, ifacePtr ...interface{}) macaron.Handler {
|
||||
obj := reflect.New(reflect.TypeOf(obj))
|
||||
|
||||
val := obj.Elem()
|
||||
for k, v := range ctx.AllParams() {
|
||||
for k, v := range macaron.Params(ctx.Req) {
|
||||
field := val.FieldByName(k[1:])
|
||||
if field.IsValid() {
|
||||
errors = setWithProperType(field.Kind(), v, field, k, errors)
|
||||
|
||||
Reference in New Issue
Block a user