-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: mod vendor should work offline #28029
Comments
/cc @bcmills |
Hi @mihaiav, is your example a case where I suspect you have a few options, but probably worthwhile to say a few more words about your goals. Vendoring with modules in 1.11 might be one approach that ends up working out for you, and that might be the simplest answer. That said, an alternative approach might be one of a few different options involving For example, Also, here is a nice end-to-end example from @myitcv of using GOPROXY with a filesystem: However, the best approach likely depends on exactly what you are trying to do, and what your exact constraints are. |
Bootstrapping an unpublished module into the module cache is a separate problem, for which I've filed #28835. I'd rather do that than copy the source directly into the |
You should be able to set up a The mod_vendor_replace test verifies that behavior. It's part of the fix for #27859, so you may have to build from source (from commit |
What version of Go are you using (
go version
)?go1.11 darwin/amd64
What operating system and processor architecture are you using (
go env
)?OSX 10.14
What did you do?
go mod vendor -v
What did you expect to see?
It tries to download the dependencies from the network. Unfortunately some dependencies are not available over the network because I'm using vanity domain names and the infrastructure that provides support for the vanity domain name(i.e. the http server serving the go vanity meta tags) depends on the program I'm trying to build/vendor.
I need a way to copy the dependencies into the vendor directory from the local disk/GOPATH instead to download them just like
govendor +external
tool did. Is there any such feature planned?I've tried to set GOPROXY to GOPATH (
export set GOPROXY=$GOPATH/src
) but when I do that go mod vendor reportsno dependencies to vendor
The text was updated successfully, but these errors were encountered: