trySetCustom tries to set a custom type value If the value implements the BindUnmarshaler interface, it will be used to set the value, we will return `true` to skip the default value setting.
(val string, value reflect.Value)
| 189 | // If the value implements the BindUnmarshaler interface, it will be used to set the value, we will return `true` |
| 190 | // to skip the default value setting. |
| 191 | func trySetCustom(val string, value reflect.Value) (isSet bool, err error) { |
| 192 | switch v := value.Addr().Interface().(type) { |
| 193 | case BindUnmarshaler: |
| 194 | return true, v.UnmarshalParam(val) |
| 195 | } |
| 196 | return false, nil |
| 197 | } |
| 198 | |
| 199 | // trySetUsingParser tries to set a custom type value based on the presence of the "parser" tag on the field. |
| 200 | // If the parser tag does not exist or does not match any of the supported parsers, gin will skip over this. |
no test coverage detected