]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/modfetch: delete unused isVendoredPackage function
authorBryan C. Mills <bcmills@google.com>
Mon, 24 Feb 2020 14:21:04 +0000 (09:21 -0500)
committerBryan C. Mills <bcmills@google.com>
Mon, 24 Feb 2020 19:06:40 +0000 (19:06 +0000)
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>
src/cmd/go/internal/modfetch/coderepo.go

index d1d24a40c96cdd76a28306e904ef4c833fb35ff8..753f65b3de4b864864bea296c172d2a10517e926 100644 (file)
@@ -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:], "/")
-}