gin/binding
chuanye-gao 4acc3a035c fix(binding): don't modify map fields when form JSON binding fails
setWithProperType decoded the form value straight into the destination field. Some JSON codecs write to the destination before reporting an error: jsoniter allocates a map, or replaces it with an empty one, before it reports a syntax error, while encoding/json leaves the field untouched. A failed bind therefore left the map field in a different state depending on the codec the binary was built with.

Decode into a temporary value and assign it only once decoding succeeded, so a failed bind never modifies the destination. The success path is unchanged.
2026-09-27 22:57:31 +08:00
..
2025-04-12 00:00:59 +08:00
2022-05-30 15:16:10 +08:00