feat(binding): support custom struct tag

Add function `binding.MapFormWithTag` (#2719)
This commit is contained in:
mtt0 2021-05-14 11:52:02 +08:00
parent 4fe5f3e4b4
commit 85db5b48fe

View File

@ -26,6 +26,10 @@ func mapForm(ptr interface{}, form map[string][]string) error {
return mapFormByTag(ptr, form, "form")
}
func MapFormWithTag(ptr interface{}, form map[string][]string, tag string) error {
return mapFormByTag(ptr, form, tag)
}
var emptyField = reflect.StructField{}
func mapFormByTag(ptr interface{}, form map[string][]string, tag string) error {