3 ms·
> Right now, we have the magical //go:generate comment, but since it requires manual invocation of "go generate", artifacts can and do get out of sync with the
by chimeracoder 9y ago
> Right now, we have the magical //go:generate comment, but since it requires manual invocation of "go generate", artifacts can and do get out of sync with the Go code.
It's pretty easy to enforce that as a build constraint in your CI system; we do that with our Go projects. If the output of `go generate` isn't checked into git, the build fails. (Same if the code hasn't been formatted with gofmt).
- lobster_johnson 9y agoTrue, but you have to do it for every single project. We have tons of apps that all need to manage little rules like this, it gets pretty exhausting after a while.
- ghthor 9y agoAnd NOT having to maintain little rules like this is one of the reasons I fell in love with Go initially. Between gofmt and gofix, the go tooling just works(tm) so danm well.