Closed arp242 closed 7 years ago
Looks like the intermittent test failures are due to another bug that my test just happened to stumble upon?
formam_test.go:790: Expected len() 1 got 0
Don't think that should ever happen.
A slice requires of a number as index for to set a value, like: s := []string{} vals := url.Values{ "[0]": []string{"Homer"}, "[1]": []string{"Marge"}, "[2]": []string{"Marge"}, }
IgnoreUknownKeys
is only for structs. If IgnoreUknownKeys
is true, it not will affects in slice, only structs. In a struct, a key like "Boo" is correct and if any field of the struct not matches with "Boo" and IgnoreUknownKeys
is true, it will be ignored. But in a slice, a key like "Foo" is not correct, it should be a number, therefore formam will raises an error of bad syntax.
Ah, that makes sense 👍 Fixed it.
Sorry to bother you @dashaus, but I think this should be ready to merge now? Or is there anything else you would like to see changed?
Thank you! :-)
I'm really sorry @Carpetsmoker. I forgot completely to do the merge.
Not a problem. Thank you :+1:
For example:
Previously this would error out with:
I don't think this is the correct behaviour if
IgnoreUnknownKeys
is given.