Rollback check code

This commit is contained in:
guonaihong 2019-06-26 13:05:10 +08:00
parent c438fc1bc1
commit 8a7e38a879
2 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,8 @@ type setter interface {
type formSource map[string][]string
var _ setter = formSource(nil)
// TrySet tries to set a value by request's form source (like map[string][]string)
func (form formSource) TrySet(value reflect.Value, field reflect.StructField, tagValue string, opt setOptions) (isSetted bool, err error) {
return setByForm(value, field, form, tagValue, opt)

View File

@ -27,6 +27,8 @@ func mapHeader(ptr interface{}, h map[string][]string) error {
type headerSource map[string][]string
var _ setter = headerSource(nil)
func (hs headerSource) TrySet(value reflect.Value, field reflect.StructField, tagValue string, opt setOptions) (isSetted bool, err error) {
return setByForm(value, field, hs, textproto.CanonicalMIMEHeaderKey(tagValue), opt)
}