1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:38:32 -06:00

godoc/redirect: redirect design docs to Gerrit, not GitHub

Gerrit's rendering is cleaner and Gerrit is the source of truth anyway.

Fixes golang/go#26871.

Change-Id: I0bf69d174662c7acc083b03b009bac92f781a17c
Reviewed-on: https://go-review.googlesource.com/128596
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Russ Cox 2018-08-08 13:50:59 -04:00
parent 5b5e9c877a
commit ad8705d9f6
2 changed files with 6 additions and 6 deletions

View File

@ -99,7 +99,7 @@ var redirects = map[string]string{
"/issues": "https://github.com/golang/go/issues", "/issues": "https://github.com/golang/go/issues",
"/issues/new": "https://github.com/golang/go/issues/new", "/issues/new": "https://github.com/golang/go/issues/new",
"/play": "http://play.golang.org", "/play": "http://play.golang.org",
"/design": "https://github.com/golang/proposal/tree/master/design", "/design": "https://go.googlesource.com/proposal/+/master/design",
// In Go 1.2 the references page is part of /doc/. // In Go 1.2 the references page is part of /doc/.
"/ref": "/doc/#references", "/ref": "/doc/#references",
@ -115,7 +115,7 @@ var redirects = map[string]string{
"/tour": "http://tour.golang.org", "/tour": "http://tour.golang.org",
"/wiki": "https://github.com/golang/go/wiki", "/wiki": "https://github.com/golang/go/wiki",
"/doc/articles/c_go_cgo.html": "/blog/c-go-cgo", "/doc/articles/c_go_cgo.html": "/blog/c-go-cgo",
"/doc/articles/concurrency_patterns.html": "/blog/go-concurrency-patterns-timing-out-and", "/doc/articles/concurrency_patterns.html": "/blog/go-concurrency-patterns-timing-out-and",
"/doc/articles/defer_panic_recover.html": "/blog/defer-panic-and-recover", "/doc/articles/defer_panic_recover.html": "/blog/defer-panic-and-recover",
"/doc/articles/error_handling.html": "/blog/error-handling-and-go", "/doc/articles/error_handling.html": "/blog/error-handling-and-go",
@ -245,6 +245,6 @@ func designHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
name := r.URL.Path[len(prefix):] name := r.URL.Path[len(prefix):]
target := "https://github.com/golang/proposal/blob/master/design/" + name + ".md" target := "https://go.googlesource.com/proposal/+/master/design/" + name + ".md"
http.Redirect(w, r, target, http.StatusFound) http.Redirect(w, r, target, http.StatusFound)
} }

View File

@ -53,10 +53,10 @@ func TestRedirects(t *testing.T) {
"/wiki/foo": {302, "https://github.com/golang/go/wiki/foo"}, "/wiki/foo": {302, "https://github.com/golang/go/wiki/foo"},
"/wiki/foo/": {302, "https://github.com/golang/go/wiki/foo/"}, "/wiki/foo/": {302, "https://github.com/golang/go/wiki/foo/"},
"/design": {301, "https://github.com/golang/proposal/tree/master/design"}, "/design": {301, "https://go.googlesource.com/proposal/+/master/design"},
"/design/": {302, "/design"}, "/design/": {302, "/design"},
"/design/123-foo": {302, "https://github.com/golang/proposal/blob/master/design/123-foo.md"}, "/design/123-foo": {302, "https://go.googlesource.com/proposal/+/master/design/123-foo.md"},
"/design/text/123-foo": {302, "https://github.com/golang/proposal/blob/master/design/text/123-foo.md"}, "/design/text/123-foo": {302, "https://go.googlesource.com/proposal/+/master/design/text/123-foo.md"},
"/cl/1": {302, "https://go-review.googlesource.com/1"}, "/cl/1": {302, "https://go-review.googlesource.com/1"},
"/cl/1/": {302, "https://go-review.googlesource.com/1"}, "/cl/1/": {302, "https://go-review.googlesource.com/1"},