Skip to content
New issue

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

Fixed Issue8 - GetInt() would fail trying to get an int from json #9

Merged
merged 3 commits into from
Nov 13, 2020

Conversation

tempcke
Copy link
Contributor

@tempcke tempcke commented Oct 30, 2020

Fixes #8

GetInt() would fail trying to get an int from json because all numbers in json become float64

From the docs: https://golang.org/pkg/encoding/json/#Unmarshal

To unmarshal JSON into an interface value, Unmarshal stores one of these in the interface value:

bool, for JSON booleans
float64, for JSON numbers
string, for JSON strings
[]interface{}, for JSON arrays
map[string]interface{}, for JSON objects
nil for JSON null

@tempcke
Copy link
Contributor Author

tempcke commented Nov 11, 2020

@miladrahimi so will this get accepted in then?

@miladrahimi miladrahimi merged commit 602a72c into golobby:master Nov 13, 2020
@miladrahimi
Copy link
Member

@tempcke Thanks for your contribution and making this open source package more useful.
Your changes are merged and released as v1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

GetInt report an error
2 participants