Code generation playground

The goal of the project is to have every common usage of code generation in a typical Golang project.

The project uses Standard Go Project Layout as a basis

Code generation samples

  • OpenAPI generation with swag, see main.go
  • Stringer with stringer internal/app/example/model/model.go
  • Interface mocking for tests with Mockery, see main_test.go
  • SQL Query code generation with sqlc, see ``

Installing tools

make install_tools

Generating code

Run the following code to invoke code generation:

make generate