mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)
https://mholt.github.io/json-to-go/
MIT License
4.51k stars 475 forks source link

Go to JSON #62

Closed plutov closed 5 years ago

plutov commented 5 years ago

I was using the site to convert JSON to Go structs, but recently I wanted to do an opposite to get a JSON string from my Go struct, and it's not yet possible.

Do you think it will make sense to have this option as well? Using left/right arrows and make interface bi-directional.

If you are happy with this idea, I can provide a PR.

mholt commented 5 years ago

I'm not sure what the output would be, since JSON is not strongly typed; I'd rather not get into JSON schemas or anything like that.