this project just made a GUI app, copy json to left textarea then click elsewhere(just blur) you will get struct info
I used a open source project(much appreciated):https://github.com/asticode/go-astilectron
by the way , the parse json part is my another project https://github.com/GrayOxygen/json-go-struct
- not only nest struct , also multi separate struct
- same struct name rule
from top to bottom , use father node name + current name as a new name
you can download app https://github.com/GrayOxygen/json-go-struct-app/releases just unzip release file to get app
exe or mac app, if you use mac app , you just unzip file to anywhere,double click JsonGoStructApp,can be work , I mean there is no mac app in Applications for you,cuz I generated mac app,but not work be a app in Applications
Or you can also install manually follow below 5 steps to get app if you want change my code for your purpose .
Run the following commands:
$ go get -u github.com/GrayOxygen/json-go-struct-app/...
$ rm $GOPATH/src/github.com/GrayOxygen/json-go-struct-app/bind.go
Run the following command:
$ go get -u github.com/asticode/go-astilectron-bundler/...
And don't forget to add $GOPATH/bin
to your $PATH
.
Run the following commands:
$ cd $GOPATH/src/github.com/GrayOxygen/json-go-struct-app
$ astilectron-bundler -v
The result is in the output/<your os>-<your arch>
folder and is waiting for you to use it!
To bundle the app for more environments, add an environments
key to the bundler configuration (bundler.json
):
"environments": [
{"arch": "amd64", "os": "linux"},
{"arch": "amd64", "os": "windows"},
{"arch": "386", "os": "windows"},
{"arch": "amd64", "os": "darwin"},
]
and repeat step 3.