About JSON to Go
Go structs need two things a naive generator skips: a json tag on every field whose name differs from the key, and a way to distinguish an absent value from a zero one.
Field names are exported and pascal-cased, which almost always differs from the JSON key, so every field gets a tag. Optional fields also get omitempty, so marshalling back out does not invent keys the API never sent.
Optional and nullable fields are emitted as pointers. That is how Go tells absent from zero, and it matters far more than it first appears: without a pointer, a missing integer and an integer that is genuinely 0 are indistinguishable once unmarshalled.
How to generate Go types
Paste your JSON
A whole array is better than one object — more samples means a more accurate type.
Name the root type
Nested objects are named automatically from the keys that hold them.
Copy the definitions
Types are emitted children first, so the file compiles in order.