diff --git a/cmd/golangorg/x.go b/cmd/golangorg/x.go index bde63098..1b3de3fe 100644 --- a/cmd/golangorg/x.go +++ b/cmd/golangorg/x.go @@ -26,7 +26,7 @@ func init() { func xHandler(w http.ResponseWriter, r *http.Request) { if !strings.HasPrefix(r.URL.Path, xPrefix) { // Shouldn't happen if handler is registered correctly. - http.Redirect(w, r, "https://godoc.org/-/subrepo", http.StatusTemporaryRedirect) + http.Redirect(w, r, "https://pkg.go.dev/search?q=golang.org/x", http.StatusTemporaryRedirect) return } proj, suffix := strings.TrimPrefix(r.URL.Path, xPrefix), "" @@ -34,7 +34,7 @@ func xHandler(w http.ResponseWriter, r *http.Request) { proj, suffix = proj[:i], proj[i:] } if proj == "" { - http.Redirect(w, r, "https://godoc.org/-/subrepo", http.StatusTemporaryRedirect) + http.Redirect(w, r, "https://pkg.go.dev/search?q=golang.org/x", http.StatusTemporaryRedirect) return } repo, ok := repos.ByGerritProject[proj] @@ -42,15 +42,10 @@ func xHandler(w http.ResponseWriter, r *http.Request) { http.NotFound(w, r) return } - docSite := "godoc.org" - if repo.UsePkgGoDev() { - docSite = "pkg.go.dev" - } data := struct { - DocSite string // Website providing documentation, either "godoc.org" or "pkg.go.dev". - Proj string // Gerrit project ("net", "sys", etc) - Suffix string // optional "/path" for requests like /x/PROJ/path - }{docSite, proj, suffix} + Proj string // Gerrit project ("net", "sys", etc) + Suffix string // optional "/path" for requests like /x/PROJ/path + }{proj, suffix} if err := xTemplate.Execute(w, data); err != nil { log.Println("xHandler:", err) } @@ -62,10 +57,10 @@ var xTemplate = template.Must(template.New("x").Parse(` - +
-Nothing to see here; move along. +Nothing to see here; move along.