go mod vendor without update to latest
我想弄清楚是否可以在不使用go工具更新go.mod文件的情况下运行go mod供应商。
我专门
然后,我运行
我无济于此:https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away
我需要使用供应商,因为我运行的脚本可以编辑某些供应商的部门。我正在查看以下构建流程:
1 2 3 4 | GO111MODULE=on go get package/subpackge@commit GO111MODULE=on go mod vendor ./Script/patch_vendors.sh --write GO111MODULE=off go build |
我的另一种选择是修改复制的源代码,无论供应商将其下载到何处,但是
不知道该如何处理。
提前致谢
根据https://tip.golang.org/cmd/go/#hdr-Maintaining_module_requirements:
The
go command itself automatically updates thego.mod file to maintain a standard formatting and the accuracy ofrequire statements.Any go command that finds an unfamiliar import will look up the module containing that import and add the latest version of that module to go.mod automatically. […]
Any go command can determine that a module requirement is missing and must be added […].
因此,这里的问题很可能是您为