7 ms·
> Go actually has a built-in "Go generate" command that will look for magic "//go:generate <command>" comments in the code and automatically run code generation
by ben0x539 7y ago
> Go actually has a built-in "Go generate" command that will look for magic "//go:generate <command>" comments in the code and automatically run code generation based on them, although I'm not sure how ergonomic it is.
But it's still not run automatically at build time, you have to go out of your way to run `go generate`, which isn't gonna happen if you, as is customary, fetch and build third-party code with `go get`.
- nordsieck 7y ago> which isn't gonna happen if you, as is customary, fetch and build third-party code with `go get`. Except that the convention is to check in the files generated by go generate, so in practice, it's not actually a problem.