|
|
|
|
|
by marcus_holmes
672 days ago
|
|
This. In $other_language you'll parse the JSON fine, but then smack into problems when the field you're expecting to be there isn't, or is in the wrong format, or the wrong type, etc. In Go, as always, this is up front and explicit. You hit that problem when you parse the JSON, not later when you try to use the resulting data. |
|
For example, this will parse just fine [0]:
This is arguably worse than what you'd get in Python if you tried to access the key "first".[0] https://go.dev/play/p/m0J2wVyMRkd