FWIW, this is maybe an area where Go goes against the grain a bit and goes out of its way to not allow code you just downloaded to execute anything while you are building.
For things like 'go generate', the convention is to check in the results, which means a consumer of a package has the results without executing code:
For things like 'go generate', the convention is to check in the results, which means a consumer of a package has the results without executing code:
https://go.dev/blog/generate