json to go struct converter
- Python 100%
| .gitignore | ||
| json2go | ||
| LICENSE | ||
| README.md | ||
json2go
json to go struct converter
Command
usage: json2go [-h] [-i INPUT] [-b BUFFER] [-n NAME] [-o]
convert json to go structs
options:
-h, --help show this help message and exit
-i INPUT, --input INPUT
file: <file.json> or stdin: -
-b BUFFER, --buffer BUFFER
indent text
-n NAME, --name NAME struct name
-o, --omit add omitempty
thanks for using json2go!
Usage
Read from file
json2go -i test.json
Read from stdin
cat test.json | json2go -i -
json2go -i $(echo test.json)
Change indentation string
json2go -i test.json -b " "
Name the struct instead of the default AutoGenerated
json2go -i test.json -n TestStruct
Add omitempty tags to the json output
json2go -i test.json -o