mirror of
https://github.com/golang/go
synced 2024-11-23 19:50:06 -07:00
cmd/go/internal/modfetch: delete unused isVendoredPackage function
This function is apparently unused since CL 204917. Updates #35290 Updates #37397 Change-Id: Id7f5f5d5176fdbd1c5c6227e81d0854ceafc3f12 Reviewed-on: https://go-review.googlesource.com/c/go/+/220640 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
d243408ae5
commit
78a608d785
@ -1012,28 +1012,3 @@ func hasPathPrefix(s, prefix string) bool {
|
||||
return s[len(prefix)] == '/' && s[:len(prefix)] == prefix
|
||||
}
|
||||
}
|
||||
|
||||
func isVendoredPackage(name string) bool {
|
||||
var i int
|
||||
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
|
||||
}
|
||||
return strings.Contains(name[i:], "/")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user