Instead of returning awkward untyped error strings, return real error
structs. This will allow users of the library to extract interesting
semantic meaning from our errors, and is just all around less awful than
what we had before.
Previously, we disallowed setting the empty string as a key in a map,
since at the time it seemed like doing so would allow all sorts of
unsavory bugs. In practice, I think this probably isn't actually true,
as I wasn't able to think of a scenario in which this bug would
materialize during the several moments I thought about it.
Plus, the code here to do sanity checking was wrong anyways.
Package param implements parameter parsing into a target struct (in much the
same way as encoding/json parses JSON into a struct). It targets the common
jQuery.param / Ruby on Rails style parameter serialization format.