go-playground / form

:steam_locomotive: Decodes url.Values into Go value(s) and Encodes Go value(s) into url.Values. Dual Array and Full map support.
MIT License
758 stars 41 forks source link

Invalid data in float type array fields reports incorrect text #50

Closed litvi-l closed 3 years ago

litvi-l commented 3 years ago

When passing in an array of float values where one of them (but not the first one) leads to parsing error, the error message will always mention the first array element instead. Notice how https://github.com/go-playground/form/blob/master/decoder.go#L320 and https://github.com/go-playground/form/blob/master/decoder.go#L332 reference arr[0] as opposed to other checks, which all use arr[idx]. Even makes me wonder if it's intentional, but I cannot think why it would be set up this way.