myitcv / x

Mono-repo for all myitcv.io/... Go code
MIT License
104 stars 20 forks source link

proposal: cmd/vartojson #137

Closed myitcv closed 5 years ago

myitcv commented 5 years ago

A go generate code generator that is given the name of a variable declaration and JSON marshals that value to a .json file in the same directory.

There will be certain limitations to this and plenty of edge cases.

First cut could likely restrict the RHS of the variable declaration to literals. i.e. no expressions, function calls, variables