]> Cypherpunks repositories - gostls13.git/commit
cmd/go: unify trimpath logic for -mod=vendor, -mod=mod
authorJay Conrod <jayconrod@google.com>
Wed, 22 Jan 2020 23:46:11 +0000 (15:46 -0800)
committerJay Conrod <jayconrod@google.com>
Thu, 23 Jan 2020 16:52:00 +0000 (16:52 +0000)
commit64378c233b69ca577a23a85285aa9adf3849d7f5
tree7c2e18d15138a9089ee4fcc8c9c89fc6c271fee2
parent82a2f825b7163eafebbf9b8640ef6406e4dda9a9
cmd/go: unify trimpath logic for -mod=vendor, -mod=mod

If a package has a module with a version, the package's directory is
replaced with the module path and version, followed by the package's
path within the module.

This is a follow up to CL 214945. We no longer check whether the
module has a directory (with -mod=vendor, it does not).

Updates #36566

Change-Id: I5bc952b13bc7b4659f58ee555bd6c6a087eb7792
Reviewed-on: https://go-review.googlesource.com/c/go/+/215940
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/work/gc.go
src/cmd/go/testdata/script/mod_vendor_trimpath.txt