I am newbie with golang and I wanted to know if there is a guideline how to integrate non-go tools into go build ecosystem. Specifically, if I need to generate go files from proto file but I do not want to do it manually every time I change my proto file is there a way to run custom build rules inside go-build system? What’s the simplest and most common approach?
Makefiles, shell scripts or Go scripts, depending on preferences.
Typically you’d generate code from protobufs manually-ish when the definitions change (using “go generate” or “make protobuf” or something) and check in the generated code. There’s no facility for custom commands triggered by “go build”.