rmasci / json2struct

Translate to Golang struct from json

Home Page:https://yudppp.github.io/json2struct

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json2struct

Create a go struct out of a json file. This will take either pipe from stdin or from a json file. (Todo: Perhaps copy it from clipboard???)

This is actually a rewrite of the json2struct command found in github.com/yudppp/json2struct I changed it to suit my needs. I've useed structs generated by this in many programs, some of them are in production without an issue. That being said, it's free, it's MIT licensed. If it blows up and causes major damage in any way -- well I didn't force you to use it.

Usage:

File In / file out

json2struct -f infile.json -o outfile.go -n structname

This will output in a file. outfile.go.

Pipe in / file out

json2struct -f infile.json -n structname

Pipe in / standard out

cat somejsonfile.json | json2struct  -n structname

About

Translate to Golang struct from json

https://yudppp.github.io/json2struct

License:MIT License


Languages

Language:Go 58.3%Language:Makefile 33.3%Language:Euphoria 8.4%