a11y.skipToMainContent
1

JSON a Go Struct

Incollare un campione JSON e ottenere corrispondenti Definizioni di Go struct — con facoltativo <code>json:"..." tag di assunzione/code>, <code>omitempty.

More options
Was this tool helpful?
Send output to:
Advertisement

How to use JSON to Go Struct

  1. Incolla un oggetto JSON (o fai clic su Campione del carico).
  2. Scegli un nome root struct (default: Root).
  3. Tick json struct tags, omitempty, o puntatore-per-opzionale se li vuoi.
  4. Copia il codice Go generato direttamente nel tuo progetto.

Che cos'e'?

Save the boilerplate of write structs by hand for any terzi API. Il generatore infers tipi (int64, float64, bool, string) e genera ricorsivamente una struttura per ogni oggetto nidiato — compresi array di oggetti. Aggiungi json struct tags in modo che Go's encoding/json

Advertisement

FAQ

Gli oggetti nidi sono supportati?
Sì — ogni oggetto nidificato diventa la sua struttura di tipo.
Il mio JSON viene caricato da qualche parte?
No. La conversione funziona interamente nel tuo browser. Nulla viene inviato a un server.

Related tools

Author

MW
Marcus Webb"The DevTool Craftsman"

Full-Stack Developer & Tools Architect

Marcus has been writing code since the dial-up era. He has contributed to open-source developer tools, built CI/CD pipelines for startups, and debugged production incidents at 3 AM more times than he would like to admit. His philosophy is that the best developer tool is the one that gets out of your way, and he writes about practical tooling that helps teams ship faster with fewer headaches.

← Back to Developer Tools · All tags

Last updated:

Advertisement