Skip to Content
Documentation

Deploying Best Practices

Best practices

gooferOrm needs to generate code to work. This means that you need to run the generator before you can use it. We recommend to use Go’s built-in go generate to run the generator.

Set up go generate

While this step is not required, we recommend to use go generate to simplify generating the gooferOrm client. To do so, you can just put the following line into a go file, and then run go generate so go run github.com/gooferOrm/goofer generate and any other generate commands you run will get executed.

Put this line into a Go file in your project, usually in main.go:

//go:generate go run github.com/gooferOrm/goofer generate func main() { // ... }

Now, run go generate:

go generate ./...

Your gooferOrm code is now generated.

Last updated on