TrySet tries to set a value by the multipart request with the binding a form file
(value reflect.Value, field reflect.StructField, key string, opt setOptions)
| 25 | |
| 26 | // TrySet tries to set a value by the multipart request with the binding a form file |
| 27 | func (r *multipartRequest) TrySet(value reflect.Value, field reflect.StructField, key string, opt setOptions) (bool, error) { |
| 28 | if files := r.MultipartForm.File[key]; len(files) != 0 { |
| 29 | return setByMultipartFormFile(value, field, files) |
| 30 | } |
| 31 | |
| 32 | return setByForm(value, field, r.MultipartForm.Value, key, opt) |
| 33 | } |
| 34 | |
| 35 | func setByMultipartFormFile(value reflect.Value, field reflect.StructField, files []*multipart.FileHeader) (isSet bool, err error) { |
| 36 | switch value.Kind() { |
nothing calls this directly
no test coverage detected