How do I make go mod vendor
copy dependencies from GOPATH
instead of downloading them over the network?
There is no way to do this in general: modules are intentionally a separate workspace from GOPATH
, and go mod vendor
copies dependencies from the module workspace.
That said, if you can figure out what versions the various repos in your GOPATH
are sync'd to, you can run go get -d <repo>@<version>
within your module for each such repo to synchronize your module workspace to that version.