gojson is a command-line tool that reads an example JSON document and writes matching Go struct definitions. It is aimed at Go developers who need to model a JSON API response or config file in code without typing out the types by hand.
The source code is public under the GPL-3.0 license, so it can be inspected, built and modified. It runs from the terminal on any platform the Go toolchain supports, and the project is distributed for free as open source.
Alternatives to gojson
Products that do a similar job in Developer Tools.
micro
terminal-based text editor with mouse support and familiar keybindings
fx
Interactive terminal viewer and processor for JSON data
wtf
Terminal dashboard for personal info and DevOps status
yq
command-line processor for YAML, JSON, XML, CSV and TOML files
gron
Command-line tool that flattens JSON into greppable lines
D2
text-based diagram scripting language and renderer
GPT Pilot
AI coding assistant that builds apps step by step from a prompt
pdfcpu
Command-line PDF processing tool and Go library