Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/packages/packagestest: skip nested module directories in copying
MustCopyFileTree is used to construct a module representation based on a real directory tree and its output consumers (e.g. Export) assume the output contains only files that belong to the module. If the real directory contains nested module directories, they need to be trimmed to satisfy the assumption. This CL implements this trimming logic - a directory containing go.mod is excluded from copying if the directory is not the top-level directory. Change-Id: Ib09d4d74e120b502e338a021042d4d5e00719f23 Reviewed-on: https://go-review.googlesource.com/c/tools/+/358037 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
- Loading branch information
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters