json to golang struct definition lib

65 views
Skip to first unread message

sanye

unread,
Mar 25, 2020, 8:05:01 PM3/25/20
to golang-nuts
Hello gophers,

I found an interesting project: https://github.com/mholt/json-to-go ,
which translate given json data into golang struct definition, it's very
useful when dealing with complex json

It's written in javascript, but maybe a golang version is useful when
doing some works like code generation, so I ported it to golang:
https://github.com/kumakichi/json-to-go

Any feedback are appreciated.

sanye

Amnon Baron Cohen

unread,
Mar 26, 2020, 4:29:27 AM3/26/20
to golang-nuts
An interesting approach.

Slightly surprised you did not use "encodeing/json" to parse the json input,
which would have been much easier.

sanye

unread,
Mar 26, 2020, 10:27:52 AM3/26/20
to golan...@googlegroups.com


On 3/26/20 4:29 PM, Amnon Baron Cohen wrote:
An interesting approach.

Slightly surprised you did not use "encodeing/json" to parse the json input,
which would have been much easier.
Thank you for your advice, I have removed 3rd dependencies, and it is indeed much easier

On Thursday, 26 March 2020 00:05:01 UTC, sanye wrote:
Hello gophers,

I found an interesting project: https://github.com/mholt/json-to-go ,
which translate given json data into golang struct definition, it's very
useful when dealing with complex json

It's written in javascript, but maybe a golang version is useful when
doing some works like code generation, so I ported it to golang:
https://github.com/kumakichi/json-to-go

Any feedback are appreciated.

sanye

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/d8b41228-2b54-41f6-bfc5-9adef9e46722%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages