Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
5いいね 159回再生

Golang code generation basics

You will learn the basics on how to build a code generator in Go. A simple example is shown to get you started. All the code discussed here is available on Github: github.com/gorlug/golang-code-generation

This video is also available as a blog post: medium.com/@achim.rohn/golang-code-generation-basi…

Why code generation?

There are many cases where a lot of the code is the same but only differs in some slight variations. An example of that are CRUD database operations. Here the basic CRUD code is like 90% the same with the only changes being table and column names. Only if you have some more complex queries for the database does the code differ more significantly.

So why not just generate the code that is 90% the same?

コメント