I’m trying to figure out if it’s possible to run go mod vendor without the go tool updating my go.mod file.
I specifically go get package/subpackage@commit
and commit my go.mod
with the correct version.
Then I run go mod vendor
and it automatically bumps the version of the package that I just specifically set.
I’ve looked at this page to no avail: https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away
I need to use vendor because I run a script that edits some of the vendored deps., I’m looking at the following build flow:
GO111MODULE=on go get package/subpackge@commit
GO111MODULE=on go mod vendor
./Script/patch_vendors.sh --write
GO111MODULE=off go build
My other option is modifying the copied source wherever go mod vendor donwloads it to, but not sure how to approach that.
Thanks in advance
go -mod=readonly mod vendor
. – Precedencygo build
– Pollygo mod
used to ignore the-mod
flag. I'm not sure if that changed by now. – Precedency