JSON → Go struct

Turns JSON into Go structs with json tags, gofmt-aligned: ID and URL as Go spells them, int64 or float64 by the values, pointers for nullable fields.

In
JSON
Out
GO
Options
Input · JSON
Output · GO

Waiting for input

Runs in this tab. The text is not sent anywhere.

Related

Questions

When is a field a pointer?

When it is sometimes null, and for a nested struct that is sometimes missing — so "absent" can be told from "zero".

What does omitempty do here?

It is added to the tags of fields that are missing in some records, so encoding leaves them out when empty.

↑ ↓ move · Enter open · Esc close