internal: remove gopkg.in from three-element vcs hosts
Fixes golang/go#49762
Change-Id: Ia52b3e8fe483057c8363f3551a4f631005667eaa
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/366578
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/internal/frontend/section.go b/internal/frontend/section.go
index 1986398..0a24fde 100644
--- a/internal/frontend/section.go
+++ b/internal/frontend/section.go
@@ -124,6 +124,8 @@
switch {
case internal.VCSHostWithThreeElementRepoName(parts[0]):
n = 1
+ case parts[0] == "gopkg.in":
+ n = 1
case parts[0] == "hub.jazz.net":
n = 2
default:
diff --git a/internal/frontend/urlinfo_test.go b/internal/frontend/urlinfo_test.go
index 3722c14..7f66286 100644
--- a/internal/frontend/urlinfo_test.go
+++ b/internal/frontend/urlinfo_test.go
@@ -197,6 +197,7 @@
{"golang.org/x", false},
{"golang.org/x/tools", true},
{"golang.org/x/tools/go/packages", true},
+ {"gopkg.in/yaml.v2", true},
}
for _, test := range tests {
got := isValidPath(test.path)
diff --git a/internal/paths.go b/internal/paths.go
index 89d5059..89fd53b 100644
--- a/internal/paths.go
+++ b/internal/paths.go
@@ -20,7 +20,6 @@
"gitea.com",
"gitee.com",
"gitlab.com",
- "gopkg.in",
"hg.sr.ht",
"bitbucket.org",
"github.com",