On Fri, Aug 06, 2021 at 12:35:16AM -0700, Brian Candler wrote: > The key point I just learned from #40276: > "Vendor directories are not included in module zip files." > > I found this surprising because -mod=vendor is now the default (here > <https://golang.org/ref/mod#vendoring>) - therefore, I expected the vendor > directory, if present in the source, always to be used unless explicitly > disabled.
An interesting point regarding our particular case - which I sadly failed to mention - is that we do not use any module proxies for own internal projects, and the hostname of our GitLab instance is listed in the GONOPROXY environment variable, so technically `go install` did not download a "classic" module, which is a ZIP archive file, but has rather performed the usual sequence of issuing a HTTP GET request with the "?go-get=1" query parameter followed by a shallow clone of the target Git repository. Hence technically the "vendor" directory with its full contents was available. But yes, that point of yours is a sensilbe one; it sheds some light on the reasoning behind the behaviour have observed. [...] > It might also be worth a mention at https://golang.org/ref/mod#zip-files > that vendor directories are excluded from module zip files (although I > wouldn't be reading that section if I was only interested in how vendoring > works) I would say the doc could make use of some cross-referencing: this fact could be mentioned either there or in the section on vendoring, and the remaining section could contain a single statement about the fact with the link to a full explanation in the other section. What do you think? [...] -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/20210806104542.2wmd7c3vfn6ohrt6%40carbon.