We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What could be done is the Env map could be turned to a type and some convenience methods could be added for type casting, to avoid doing .(int) etc.
Something like Env.Int("param_name") or similar.
The text was updated successfully, but these errors were encountered:
What would be the benefit over type assertions (eg: .(int)) ? This is the same amount of typing, and type assertions seem more Go-ish.
Sorry, something went wrong.
It's just nicer this way, you get autocomplete for some common types, also ForceType is also nice to have for convenience.
I've stolen this idea from https://godoc.org/github.com/garyburd/redigo/redis#hdr-Reply_Helpers , feel free to browse through it.
I thing the benefit is caller does not assert type itself. Maybe the method can be assert and return zero value when Env cannot assert.
Exactly!
On Wed, Jan 20, 2016 at 11:36 AM Thanabodee Charoenpiriyakij < [email protected]> wrote:
I thing the benefit is caller does not assert type itself. Maybe the method can be assert and return zero value when Env cannot assert. — Reply to this email directly or view it on GitHub #168 (comment) .
— Reply to this email directly or view it on GitHub #168 (comment) .
No branches or pull requests
What could be done is the Env map could be turned to a type and some convenience methods could be added for type casting, to avoid doing .(int) etc.
Something like Env.Int("param_name") or similar.
The text was updated successfully, but these errors were encountered: