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

Error when binding structs with dates #39

Open
javiermanzano opened this issue Feb 18, 2015 · 3 comments
Open

Error when binding structs with dates #39

javiermanzano opened this issue Feb 18, 2015 · 3 comments

Comments

@javiermanzano
Copy link

I've just had a problem while trying to bind a struct with some dates on it like this

{"birthDate":"2015-02-19T00:00:00", "name": "name", "place": "Málaga"}

It evens doesn't show me any error... It just doesn't bind any data.

Anyone on this?

@mholt
Copy link
Contributor

mholt commented Feb 18, 2015

What does your struct definition look like?

@javiermanzano
Copy link
Author

The problem was that date was missing "Z" at the end. A correct JSON would be:

{"birthDate":"2015-02-19T00:00:00", "name": "name", "place": "Málaga"}

It's because the use of the encoding/json package. Shouldn't it throw any error instead of returning me an instance that does not contain anything?

@mholt
Copy link
Contributor

mholt commented Feb 25, 2015

I'm not sure... that might have more to do with the encoding/json package. I've been super-busy the last few weeks; have you taken the chance to peruse the source and see how it handles time.Time fields?

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

No branches or pull requests

2 participants