]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: have go mod vendor copy embedded files in subdirs
authorMichael Matloob <matloob@golang.org>
Thu, 14 Jan 2021 01:58:00 +0000 (20:58 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 20 Jan 2021 17:37:54 +0000 (17:37 +0000)
commit6e243ce71d910876839d1bad4adf9b259c3a8e21
tree80b82ce3fe20e21accef4e12ed20850a19505502
parentbe28e5abc5ddca0d6b2d8c91b7bb9c05717154e7
cmd/go: have go mod vendor copy embedded files in subdirs

If a package vendored with go mod vendor depends on embedded
files contained in subdirectories, copy them into the the
corresponding place in the module's vendor tree. (Embeds in
parent directories are disallowed by the embed pattern rules, and
embeds in the same directory are copied because go mod vendor
already copies the non-go files in the package's own directory).

Export the vendor pattern expansion code in internal/load so
internal/modcmd's vendor code can use it.

Fixes #43077

Change-Id: I61edb344d73df590574a6498ffb6069e8d72a147
Reviewed-on: https://go-review.googlesource.com/c/go/+/283641
Trust: Michael Matloob <matloob@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/list/list.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/test.go
src/cmd/go/internal/modcmd/vendor.go
src/cmd/go/testdata/script/embed.txt
src/cmd/go/testdata/script/mod_vendor_embed.txt [new file with mode: 0644]