Generating Go Code with Go Generate
Introduction Let’s get straight to it.
You have a json schema/structure and you want to generate the struct for it. There are tools for this, such as JSON to Go, but here’s a simple implementation, as part of the introduction
We’ll create 4 files.
post.json - to hold the json schema of the code we are trying to generate post.tpl - to hold the template with which the code will be generated from gen.
[Read More]