aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modfetch/coderepo.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-04-19 10:15:58 -0400
committerBryan C. Mills <bcmills@google.com>2019-04-19 18:08:17 +0000
commit47150aafbfaadf1f193b8840df02f388998e83ab (patch)
tree5caed3196683da28648bf46b5f2bb23720088ecc /src/cmd/go/internal/modfetch/coderepo.go
parent64e29f94e29ce6fa01537f639aec5fbea28a6a7f (diff)
downloadgo-47150aafbfaadf1f193b8840df02f388998e83ab.tar.gz
go-47150aafbfaadf1f193b8840df02f388998e83ab.zip
cmd/go/internal/modfetch: comment on known bug in isVendoredPackage
Fixes #31562 Change-Id: Ida30dd8071eccb6b490ab89a1de087038fe26796 Reviewed-on: https://go-review.googlesource.com/c/go/+/172977 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modfetch/coderepo.go')
-rw-r--r--src/cmd/go/internal/modfetch/coderepo.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/go/internal/modfetch/coderepo.go b/src/cmd/go/internal/modfetch/coderepo.go
index 7aedf1d861..3581f93fe7 100644
--- a/src/cmd/go/internal/modfetch/coderepo.go
+++ b/src/cmd/go/internal/modfetch/coderepo.go
@@ -634,6 +634,19 @@ func isVendoredPackage(name string) bool {
if strings.HasPrefix(name, "vendor/") {
i += len("vendor/")
} else if j := strings.Index(name, "/vendor/"); j >= 0 {
+ // This offset looks incorrect; this should probably be
+ //
+ // i = j + len("/vendor/")
+ //
+ // (See https://golang.org/issue/31562.)
+ //
+ // Unfortunately, we can't fix it without invalidating checksums.
+ // Fortunately, the error appears to be strictly conservative: we'll retain
+ // vendored packages that we should have pruned, but we won't prune
+ // non-vendored packages that we should have retained.
+ //
+ // Since this defect doesn't seem to break anything, it's not worth fixing
+ // for now.
i += len("/vendor/")
} else {
return false