Skip to content

Commit 9bb0e23

Browse files
committed
all: replace godoc.org links with pkg.go.dev
Change links from godoc.org to pkg.go.dev. For golang/go#36106 Change-Id: Ic3ec03efc265cdc332027d538b0c5d4d91bdac24 Reviewed-on: https://go-review.googlesource.com/c/website/+/275195 Trust: Julie Qiu <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 3718ed1 commit 9bb0e23

File tree

7 files changed

+35
-40
lines changed

7 files changed

+35
-40
lines changed

cmd/golangorg/x.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,26 @@ func init() {
2626
func xHandler(w http.ResponseWriter, r *http.Request) {
2727
if !strings.HasPrefix(r.URL.Path, xPrefix) {
2828
// Shouldn't happen if handler is registered correctly.
29-
http.Redirect(w, r, "https://godoc.org/-/subrepo", http.StatusTemporaryRedirect)
29+
http.Redirect(w, r, "https://pkg.go.dev/search?q=golang.org/x", http.StatusTemporaryRedirect)
3030
return
3131
}
3232
proj, suffix := strings.TrimPrefix(r.URL.Path, xPrefix), ""
3333
if i := strings.Index(proj, "/"); i != -1 {
3434
proj, suffix = proj[:i], proj[i:]
3535
}
3636
if proj == "" {
37-
http.Redirect(w, r, "https://godoc.org/-/subrepo", http.StatusTemporaryRedirect)
37+
http.Redirect(w, r, "https://pkg.go.dev/search?q=golang.org/x", http.StatusTemporaryRedirect)
3838
return
3939
}
4040
repo, ok := repos.ByGerritProject[proj]
4141
if !ok || !strings.HasPrefix(repo.ImportPath, "golang.org/x/") {
4242
http.NotFound(w, r)
4343
return
4444
}
45-
docSite := "godoc.org"
46-
if repo.UsePkgGoDev() {
47-
docSite = "pkg.go.dev"
48-
}
4945
data := struct {
50-
DocSite string // Website providing documentation, either "godoc.org" or "pkg.go.dev".
51-
Proj string // Gerrit project ("net", "sys", etc)
52-
Suffix string // optional "/path" for requests like /x/PROJ/path
53-
}{docSite, proj, suffix}
46+
Proj string // Gerrit project ("net", "sys", etc)
47+
Suffix string // optional "/path" for requests like /x/PROJ/path
48+
}{proj, suffix}
5449
if err := xTemplate.Execute(w, data); err != nil {
5550
log.Println("xHandler:", err)
5651
}
@@ -62,10 +57,10 @@ var xTemplate = template.Must(template.New("x").Parse(`<!DOCTYPE html>
6257
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6358
<meta name="go-import" content="golang.org/x/{{.Proj}} git https://go.googlesource.com/{{.Proj}}">
6459
<meta name="go-source" content="golang.org/x/{{.Proj}} https://github.com/golang/{{.Proj}}/ https://github.com/golang/{{.Proj}}/tree/master{/dir} https://github.com/golang/{{.Proj}}/blob/master{/dir}/{file}#L{line}">
65-
<meta http-equiv="refresh" content="0; url=https://{{.DocSite}}/golang.org/x/{{.Proj}}{{.Suffix}}">
60+
<meta http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/{{.Proj}}{{.Suffix}}">
6661
</head>
6762
<body>
68-
Nothing to see here; <a href="https://{{.DocSite}}/golang.org/x/{{.Proj}}{{.Suffix}}">move along</a>.
63+
Nothing to see here; <a href="https://pkg.go.dev/golang.org/x/{{.Proj}}{{.Suffix}}">move along</a>.
6964
</body>
7065
</html>
7166
`))

cmd/golangorg/x_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestXHandler(t *testing.T) {
4848
checks: []check{
4949
status(200),
5050
substr(`<meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">`),
51-
substr(`http-equiv="refresh" content="0; url=https://godoc.org/golang.org/x/net">`),
51+
substr(`http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/net">`),
5252
},
5353
},
5454
{
@@ -57,7 +57,7 @@ func TestXHandler(t *testing.T) {
5757
checks: []check{
5858
status(200),
5959
substr(`<meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">`),
60-
substr(`http-equiv="refresh" content="0; url=https://godoc.org/golang.org/x/net/suffix">`),
60+
substr(`http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/net/suffix">`),
6161
},
6262
},
6363
{
@@ -80,7 +80,7 @@ func TestXHandler(t *testing.T) {
8080
path: "/x/",
8181
checks: []check{
8282
status(307),
83-
hasHeader("Location", "https://godoc.org/-/subrepo"),
83+
hasHeader("Location", "https://pkg.go.dev/search?q=golang.org/x"),
8484
},
8585
},
8686
{

content/static/doc/gopath_code.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ <h3 id="Workspaces">Workspaces</h3>
100100
The <code>example</code> repository contains two commands (<code>hello</code>
101101
and <code>outyet</code>) and one library (<code>stringutil</code>).
102102
The <code>image</code> repository contains the <code>bmp</code> package
103-
and <a href="https://godoc.org/golang.org/x/image">several others</a>.
103+
and <a href="https://pkg.go.dev/golang.org/x/image">several others</a>.
104104
</p>
105105

106106
<p>
@@ -595,8 +595,8 @@ <h2 id="remote">Remote packages</h2>
595595
<p>
596596
This convention is the easiest way to make your Go packages available for
597597
others to use.
598-
The <a href="//golang.org/wiki/Projects">Go Wiki</a>
599-
and <a href="//godoc.org/">godoc.org</a>
598+
<a href="//pkg.go.dev">Pkg.go.dev</a>
599+
and the <a href="//golang.org/wiki/Projects">Go Wiki</a>
600600
provide lists of external Go projects.
601601
</p>
602602

content/static/packageroot.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,32 +119,32 @@ <h3 id="subrepo">Sub-repositories</h3>
119119
Install them with "<a href="/cmd/go/#hdr-Download_and_install_packages_and_dependencies">go get</a>".
120120
</p>
121121
<ul>
122-
<li><a href="//godoc.org/golang.org/x/benchmarks">benchmarks</a> — benchmarks to measure Go as it is developed.</li>
123-
<li><a href="//godoc.org/golang.org/x/blog">blog</a><a href="//blog.golang.org">blog.golang.org</a>'s implementation.</li>
124-
<li><a href="//godoc.org/golang.org/x/build">build</a><a href="//build.golang.org">build.golang.org</a>'s implementation.</li>
125-
<li><a href="//godoc.org/golang.org/x/crypto">crypto</a> — additional cryptography packages.</li>
126-
<li><a href="//godoc.org/golang.org/x/debug">debug</a> — an experimental debugger for Go.</li>
127-
<li><a href="//godoc.org/golang.org/x/image">image</a> — additional imaging packages.</li>
128-
<li><a href="//godoc.org/golang.org/x/mobile">mobile</a> — experimental support for Go on mobile platforms.</li>
129-
<li><a href="//godoc.org/golang.org/x/net">net</a> — additional networking packages.</li>
130-
<li><a href="//godoc.org/golang.org/x/perf">perf</a> — packages and tools for performance measurement, storage, and analysis.</li>
122+
<li><a href="//pkg.go.dev/golang.org/x/benchmarks">benchmarks</a> — benchmarks to measure Go as it is developed.</li>
123+
<li><a href="//pkg.go.dev/golang.org/x/blog">blog</a><a href="//blog.golang.org">blog.golang.org</a>'s implementation.</li>
124+
<li><a href="//pkg.go.dev/golang.org/x/build">build</a><a href="//build.golang.org">build.golang.org</a>'s implementation.</li>
125+
<li><a href="//pkg.go.dev/golang.org/x/crypto">crypto</a> — additional cryptography packages.</li>
126+
<li><a href="//pkg.go.dev/golang.org/x/debug">debug</a> — an experimental debugger for Go.</li>
127+
<li><a href="//pkg.go.dev/golang.org/x/image">image</a> — additional imaging packages.</li>
128+
<li><a href="//pkg.go.dev/golang.org/x/mobile">mobile</a> — experimental support for Go on mobile platforms.</li>
129+
<li><a href="//pkg.go.dev/golang.org/x/net">net</a> — additional networking packages.</li>
130+
<li><a href="//pkg.go.dev/golang.org/x/perf">perf</a> — packages and tools for performance measurement, storage, and analysis.</li>
131131
<li><a href="//pkg.go.dev/golang.org/x/pkgsite">pkgsite</a> — home of the pkg.go.dev website.</li>
132-
<li><a href="//godoc.org/golang.org/x/review">review</a> — a tool for working with Gerrit code reviews.</li>
133-
<li><a href="//godoc.org/golang.org/x/sync">sync</a> — additional concurrency primitives.</li>
134-
<li><a href="//godoc.org/golang.org/x/sys">sys</a> — packages for making system calls.</li>
135-
<li><a href="//godoc.org/golang.org/x/text">text</a> — packages for working with text.</li>
136-
<li><a href="//godoc.org/golang.org/x/time">time</a> — additional time packages.</li>
137-
<li><a href="//godoc.org/golang.org/x/tools">tools</a> — godoc, goimports, gorename, and other tools.</li>
138-
<li><a href="//godoc.org/golang.org/x/tour">tour</a><a href="//tour.golang.org">tour.golang.org</a>'s implementation.</li>
139-
<li><a href="//godoc.org/golang.org/x/exp">exp</a> — experimental and deprecated packages (handle with care; may change without warning).</li>
132+
<li><a href="//pkg.go.dev/golang.org/x/review">review</a> — a tool for working with Gerrit code reviews.</li>
133+
<li><a href="//pkg.go.dev/golang.org/x/sync">sync</a> — additional concurrency primitives.</li>
134+
<li><a href="//pkg.go.dev/golang.org/x/sys">sys</a> — packages for making system calls.</li>
135+
<li><a href="//pkg.go.dev/golang.org/x/text">text</a> — packages for working with text.</li>
136+
<li><a href="//pkg.go.dev/golang.org/x/time">time</a> — additional time packages.</li>
137+
<li><a href="//pkg.go.dev/golang.org/x/tools">tools</a> — godoc, goimports, gorename, and other tools.</li>
138+
<li><a href="//pkg.go.dev/golang.org/x/tour">tour</a><a href="//tour.golang.org">tour.golang.org</a>'s implementation.</li>
139+
<li><a href="//pkg.go.dev/golang.org/x/exp">exp</a> — experimental and deprecated packages (handle with care; may change without warning).</li>
140140
</ul>
141141

142142
<h3 id="community">Community</h3>
143143
<p>
144144
These services can help you find Open Source packages provided by the community.
145145
</p>
146146
<ul>
147-
<li><a href="//godoc.org">GoDoc</a> - a package index and search engine.</li>
147+
<li><a href="//pkg.go.dev">Pkg.go.dev</a> - the Go package discovery site.</li>
148148
<li><a href="/wiki/Projects">Projects at the Go Wiki</a> - a curated list of Go projects.</li>
149149
</ul>
150150
{{end}}

content/static/static.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/dl/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func (h server) getHandler(w http.ResponseWriter, r *http.Request) {
209209
http.Redirect(w, r, downloadBaseURL+name, http.StatusFound)
210210
return
211211
case name == "gotip":
212-
redirectURL = "https://godoc.org/golang.org/dl/gotip"
212+
redirectURL = "https://pkg.go.dev/golang.org/dl/gotip"
213213
case goGetRe.MatchString(name):
214214
redirectURL = "https://golang.org/dl/#" + name
215215
default:

internal/redirect/redirect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var redirects = map[string]string{
9999
"/build": "http://build.golang.org",
100100
"/change": "https://go.googlesource.com/go",
101101
"/cl": "https://go-review.googlesource.com",
102-
"/cmd/godoc/": "http://godoc.org/golang.org/x/tools/cmd/godoc/",
102+
"/cmd/godoc/": "https://pkg.go.dev/golang.org/x/tools/cmd/godoc",
103103
"/issue": "https://github.com/golang/go/issues",
104104
"/issue/new": "https://github.com/golang/go/issues/new",
105105
"/issues": "https://github.com/golang/go/issues",

0 commit comments

Comments
 (0)