On Aug 14, 2012, at 8:13 AM, matryer <
mat...@mac.com> wrote:
> Here's an example of multiple values:
>
> /favourite-animals?animal=dog&animal=cat&animal=monkey
Oh duh! So simple. I've never actually used that myself. Makes total sense though. We'll definitely go with having it return <string,[]string>.
> Consistency over clever code wins here I think.
Agreed.
> Do you want to have a go at implementing the 'caching' bit for QueryParams? Usually it's as simple as:
> • make the QueryParams private (by lower-casing the Q), this becomes the internal storage value
> • write a test to assert that the queryParams value is nil (or empty)
> • add a function called QueryParams
> • write a test proving that a) QueryParams() returns something, and b) that it's the same thing stored in queryParams
> • NOTE: You can access private internal stuff when writing tests because the tests are within the same package
> • In cases of maps, nil doesn't necessarily make sense, so if that doesn't work, you might need to add a 'bool' to indicate whether the initialisation work has bee done or not.
Absolutely! I'll try to bang that out today. :)