https://github.com/golang/go/issues/25922被证明对我有帮助,特别是
在模块中使用仅构建依赖项时,重点是版本选择(不安装它们!)
为了避免安装,您可以将// go:generate指令修改为:
//go:generate go run golang.org/x/tools/cmd/stringer ARGS
还有最佳实践回购:https : //github.com/go-modules-by-
example/index/blob/master/010_tools/README.md



