DEV Community


Discussion on: Using code generation to survive without generics in Go

siteshen profile image

I've implemented database model generator use almost the same way. With the help of go:generate, model user don't have to care about the code generator. They can add model easily in this way:

cp user.go new_model.go
# adjust new_model fields && the go:generate comment
go go:generate && go build