Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
byrnedo
9 months ago
|
parent
|
context
|
favorite
| on:
Decoding JSON sum types in Go without panicking
Pulled my hair out about doing this all over the place when integrating with a node api, ended up writing
https://github.com/byrnedo/pjson
. Feels like this should be covered as a more first class thing in go.
timewizard
9 months ago
[–]
It is. That's what json.RawMessage is for. It's a shame the author didn't explore this more. It's a perfectly cromulent solution to this problem.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: