On the Web on joe blubaugh · Dec 15, 2022
Unmarshaling JSON in Go: The weird parts
0Sign in to vote or save
This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.
Quick, what does this program print? package main import ( 'encoding/json' 'fmt' ) func main () { content := []byte( `{ 'fieldone':'zero', 'field_one':'one', 'fiELD_one':'two', 'field_One':'three', 'field2':123 }` ) type d0 struct { Fieldone string Field1 string Field_One string } type d1 struct { Fieldone string `json:'field_one'` Field1 string `json:'fiELD_one'` Field_One string…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.