Closed leejh3224 closed 4 years ago
I also had a hard time adding json tags
for each generated model and found really nice go program called gomodifytags
.
If you don't mind, can I add a link to the gist for below?
tables-to-go
json tags
for each model definitionsMaybe it would help people visiting this repository to get things done quickly.
I edited the code following your comments but I may miss somethings. Thanks for guiding me in the right direction, @fraenky8
Here's the link to gomodifytags
and example usage:
gomodifytags -file fileName -struct structName -add-tags json -w --skip-unexported
Also added an example usage in README
.
added file name casing as
fnc
forcamelCase
(default) andsnake_case
As I wanted to have my out file name to be
snake_case
and it seems like there was no such option, I added this feature and added a test case for this as well.for those of you wanting to use this option before the merge, visit forked repository