Skip to content

Commit

Permalink
cmd/golangorg: check for invalid or broken links in served HTML
Browse files Browse the repository at this point in the history
Test that links are to /foo not https://go.dev/foo
and also check that the links actually point at real pages.
Manually fix problems that the test found.

For golang/go#37047.

Change-Id: I825eec3c2cadb9d259caff51cd893f3023ab533a
Reviewed-on: https://go-review.googlesource.com/c/website/+/548059
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
rsc authored and gopherbot committed Dec 8, 2023
1 parent f74533c commit 0a7f378
Show file tree
Hide file tree
Showing 60 changed files with 436 additions and 235 deletions.
8 changes: 4 additions & 4 deletions _content/blog/1year.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ a new package management tool, allows users to install and update external
packages with a single command.
[Gofmt](/cmd/gofmt/),
the Go pretty-printer, now makes syntactic simplifications where possible.
[Goplay](/misc/goplay/),
Goplay,
a web-based “compile-as-you-type” tool,
is a convenient way to experiment with Go for those times when you don’t
have access to the [Go Playground](/doc/play/).
Expand All @@ -73,7 +73,7 @@ The debugging story has gotten better, too.
Recent improvements to the DWARF output of the gc compilers make the GNU debugger,
GDB, useful for Go binaries, and we’re actively working on making that
debugging information more complete.
(See the [ recent blog post](/blog/2010/11/debugging-go-code-status-report.html) for details.)
(See the [recent blog post](/blog/debugging-go-code-status-report) for details.)

It’s now easier than ever to link against existing libraries written in
languages other than Go.
Expand All @@ -95,7 +95,7 @@ and hundreds more on [Google Code](http://code.google.com/hosting/search?q=label
and [GitHub](https://github.com/search?q=language:Go).
On our mailing list and IRC channel you can find coders from around the
world who use Go for their programming projects.
(See our [guest blog post](/blog/2010/10/real-go-projects-smarttwitter-and-webgo.html)
(See our [guest blog post](/blog/real-go-projects-smarttwitter-and-webgo)
from last month for a real-world example.) Internally at Google there are
several teams that choose Go for building production software,
and we have received reports from other companies that are developing sizable systems in Go.
Expand All @@ -117,7 +117,7 @@ many of which were driven by feedback from the community.
[spec](/doc/go_spec.html#Slices)
- The new built-in function `recover` complements `panic` and `defer` as
an error handling mechanism.
[blog](/blog/2010/08/defer-panic-and-recover.html),
[blog](/blog/defer-panic-and-recover),
[spec](/doc/go_spec.html#Handling_panics)
- The new complex number types (`complex`,
`complex64`, and `complex128`) simplify certain mathematical operations.
Expand Down
8 changes: 4 additions & 4 deletions _content/blog/2years.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ and were gradually joined by dozens - and then hundreds - of programmers
from the open source community.
The Go Authors went on to produce lots of libraries,
new tools, and reams of [documentation](/doc/docs.html).
They celebrated a successful year in the public eye with a [blog post](/blog/2010/11/go-one-year-ago-today.html)
They celebrated a successful year in the public eye with a [blog post](/blog/go-one-year-ago-today)
last November that concluded "Go is certainly ready for production use,
but there is still room for improvement.
Our focus for the immediate future is making Go programs faster and more
Expand All @@ -32,8 +32,8 @@ Today is the second anniversary of Go's release,
and Go is faster and more stable than ever.
Careful tuning of Go's code generators, concurrency primitives,
garbage collector, and core libraries have increased the performance of Go programs,
and native support for [profiling](/blog/2011/06/profiling-go-programs.html)
and [debugging](http://blog.golang.org/2011/10/debugging-go-programs-with-gnu-debugger.html)
and native support for [profiling](/blog/profiling-go-programs)
and [debugging](/blog/debugging-go-programs-with-gnu-debugger)
makes it easier to detect and remove performance issues in user code.
Go is also now easier to learn with [A Tour of Go](/tour/),
an interactive tutorial you can take from the comfort of your web browser.
Expand All @@ -57,7 +57,7 @@ This year we issued several "[release](/doc/devel/release.html)"
versions of Go that were more reliable and better supported than weekly snapshots.
We also introduced [gofix](/cmd/gofix/) to take the
pain out of migrating to newer releases.
Furthermore, last month we announced a [plan for Go version 1](/blog/2011/10/preview-of-go-version-1.html) -
Furthermore, last month we announced a [plan for Go version 1](/blog/preview-of-go-version-1) -
a release that will be supported for years to come.
Work toward Go 1 is already underway and you can observe our progress by
the latest weekly snapshot at [weekly.golang.org](http://weekly.golang.org/pkg/).
Expand Down
10 changes: 5 additions & 5 deletions _content/blog/3years.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ We added a package management system
which eventually became the
[go command](/cmd/go/).
We also added
[support for Go on App Engine](/blog/2011/07/go-for-app-engine-is-now-generally.html).
[support for Go on App Engine](/blog/go-for-app-engine-is-now-generally).
Over the past year we've also given [many talks](/doc/#talks), created an [interactive introductory tour](/tour/)
and recently we added support for [executable examples in package documentation](/pkg/strings/#pkg-examples).

Perhaps the most important development in the past year
was the launch of the first stable version,
[Go 1](/blog/2012/03/go-version-1-is-released.html).
[Go 1](/blog/go1).
People who write Go 1 programs can now be confident that their programs will
continue to compile and run without change, in many environments,
on a time scale of years.
Expand All @@ -59,7 +59,7 @@ and of course running the
[Go home page](/)
on [App Engine](https://developers.google.com/appengine/docs/go/overview).
Last year's
[Thanksgiving Doodle](/blog/2011/12/from-zero-to-go-launching-on-google.html)
[Thanksgiving Doodle](/blog/from-zero-to-go-launching-on-google)
and the recent
[Jam with Chrome](http://www.jamwithchrome.com/technology)
site are also served by Go programs.
Expand All @@ -68,11 +68,11 @@ Other companies and projects are using Go too, including
[BBC Worldwide](http://www.quora.com/Go-programming-language/Is-Google-Go-ready-for-production-use/answer/Kunal-Anand),
[Canonical](http://dave.cheney.net/wp-content/uploads/2012/08/august-go-meetup.pdf),
[CloudFlare](http://blog.cloudflare.com/go-at-cloudflare),
[Heroku](/blog/2011/04/go-at-heroku.html),
[Heroku](/blog/go-at-heroku),
[Novartis](https://plus.google.com/114945221884326152379/posts/d1SVaqkRyTL),
[SoundCloud](http://backstage.soundcloud.com/2012/07/go-at-soundcloud/),
[SmugMug](http://sorcery.smugmug.com/2012/04/06/deriving-json-types-in-go/),
[StatHat](/blog/2011/12/building-stathat-with-go.html),
[StatHat](/blog/building-stathat-with-go),
[Tinkercad](https://tinkercad.com/about/jobs),
and
[many others](/wiki/GoUsers).
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/appengine-scalable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ summary: How to build scalable web applications using Go with Google App Engine.
---


Back in May, we [announced](/blog/2011/05/go-and-google-app-engine.html)
Back in May, we [announced](/blog/go-and-google-app-engine)
the Go runtime for App Engine.
Since then, we've opened it up for everyone to use,
added many new APIs, and improved performance.
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/debug-gdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ summary: Announcing a new article about debugging Go programs with GDB.
---


Last year we [reported](/blog/2010/11/debugging-go-code-status-report.html)
Last year we [reported](/blog/debugging-go-code-status-report)
that Go's [gc](/cmd/gc/)/[ld](/cmd/6l/)
toolchain produces DWARFv3 debugging information that can be read by the GNU Debugger (GDB).
Since then, work has continued steadily on improving support for debugging Go code with GDB.
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/generics-next-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ specific topics.

If you find bugs in the generics type checker or the translation tool,
they should be filed in the standard Go issue tracker at
[https://golang.org/issue](/issue).
[go.dev/issue](/issue).
Please start the issue title with `cmd/go2go:`.
Note that the issue tracker is not the best place to discuss changes
to the language, because it does not provide threading and it is not
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/gif-decoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ It's a nice technique in Go programming to couple a slice (`b.slice`) to an arra
In this case, it means `blockReader` type's `Read` method never does any allocations.
It also means we don't need to keep a count around (it's implicit in the slice length),
and the built-in `copy` function guarantees we never copy more than we should.
(For more about slices, see [this post from the Go Blog](/blog/2011/01/go-slices-usage-and-internals.html).)
(For more about slices, see [this post from the Go Blog](/blog/go-slices-usage-and-internals).)

Given the `blockReader` type, we can unblock the image data stream just
by wrapping the input reader,
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/go1.18beta2.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The easiest way to install it alongside your existing Go toolchain is to run:
go1.18beta2 download

After that, you can run `go1.18beta2` as a drop-in replacement for `go`.
For more download options, visit https://go.dev/dl/#go1.18beta2.
For more download options, visit [go.dev/dl/#go1.18beta2](/dl/#go1.18beta2).

Because we are taking the time to issue a second beta,
we now expect that the Go 1.18 release candidate will be issued in February,
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/go1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This new back end generates more compact, more efficient code that includes
optimizations like
[bounds check elimination](https://en.wikipedia.org/wiki/Bounds-checking_elimination) and
[common subexpression elimination](https://en.wikipedia.org/wiki/Common_subexpression_elimination).
We observed a 5–35% speedup across our [benchmarks](/test/bench/go1/).
We observed a 5–35% speedup across our benchmarks.
For now, the new backend is only available for the 64-bit x86 platform ("amd64"),
but we’re planning to convert more architecture backends to SSA in future releases.

Expand Down
2 changes: 1 addition & 1 deletion _content/blog/go12.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ the new [`encoding` package](/doc/go1.2#encoding),
[indexed arguments](/doc/go1.2#fmt_indexed_arguments) in `Printf` format strings, and
some [convenient additions](/doc/go1.2#text_template) to the template packages.

As part of the release, the [Go Playground](http://play.golang.org/) has been
As part of the release, the [Go Playground](/play/) has been
updated to Go 1.2. This also affects services that use the Playground, such as
[the Go Tour](/tour/) and this blog.
The update also adds the ability to use threads and the `os`, `net`, and
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/gob.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ and it does all the work.
fmt.Printf("%q: {%d,%d}\n", q.Name, *q.X, *q.Y)
}

You can compile and run this example code in the [Go Playground](http://play.golang.org/p/_-OJV-rwMq).
You can compile and run this example code in the [Go Playground](/play/p/_-OJV-rwMq).

The [rpc package](/pkg/net/rpc/) builds on gobs to turn
this encode/decode automation into transport for method calls across the network.
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/hello-china.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ summary: "The Go home page and binary downloads is now available in China, at ht


We are thrilled to announce that the content on
[golang.org](https://golang.org) is now available in mainland China through
[golang.org](/) is now available in mainland China through
the name [https://golang.google.cn](https://golang.google.cn).
The growing Go developer community in China can now directly access official
documentation, technical articles, and binaries.
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ concurrent processes that communicate via passing messages.
In Doozer, these processes are implemented as goroutines,
and their communications as channel operations.
In the same way that garbage collectors improve upon malloc and free,
we found that [goroutines and channels](/blog/2010/07/share-memory-by-communicating.html)
we found that [goroutines and channels](/blog/share-memory-by-communicating)
improve upon the lock-based approach to concurrency.
These tools let us avoid complex bookkeeping and stay focused on the problem at hand.
We are still amazed at how few lines of code it took to achieve something
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/introducing-gofix.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Code that [implements an HTTP server handler](http://codereview.appspot.com/4239
[calls `os.Open`](http://codereview.appspot.com/4357052),
or [uses the reflect package](http://codereview.appspot.com/4281055) will
not build unless it is updated to use the new APIs.
Now that our releases are [more stable and less frequent](/blog/2011/03/go-becomes-more-stable.html),
Now that our releases are [more stable and less frequent](/blog/go-becomes-more-stable),
this will be a common situation.
Each of these API changes happened in a different weekly snapshot and might
have been manageable on its own;
Expand Down
6 changes: 3 additions & 3 deletions _content/blog/io2011.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ you can now watch videos of our two Go presentations on YouTube.
## Writing Web Apps in Go

In “[Writing Web Apps in Go](http://www.youtube.com/watch?v=-i0hat7pdpk)
we announce the [Go runtime for Google App Engine](/blog/2011/05/go-and-google-app-engine.html)
we announce the [Go runtime for Google App Engine](/blog/go-and-google-app-engine)
and walk through the development and deployment of [Moustachio](http://moustach-io.appspot.com/),
the first Go App Engine app.

{{video "https://www.youtube.com/embed/-i0hat7pdpk"}}

(See the [presentation slides](/doc/talks/io2011/Writing_Web_Apps_in_Go.pdf).)
(See the [presentation slides](/talks/2011/Writing_Web_Apps_in_Go.pdf).)

The [source code](https://code.google.com/p/appengine-go/source/browse/example/moustachio)
for Moustachio is available as part of [the SDK](http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Go)
Expand Down Expand Up @@ -57,6 +57,6 @@ gives a brief introduction to Go and four case studies of its use in solving rea

{{video "https://www.youtube.com/embed/7QDVRowyUQA"}}

(See the [presentation slides](/doc/talks/io2011/Real_World_Go.pdf).)
(See the [presentation slides](/talks/2011/Real_World_Go.pdf).)

Thanks to everyone who attended our talks and workshops. We look forward to seeing you again soon!
6 changes: 3 additions & 3 deletions _content/blog/io2013-talk-concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ summary: Watch Sameer Ajmani's talk, “Advanced Go Concurrency Patterns,” fro
At Google I/O a year ago Rob Pike presented [_Go Concurrency Patterns_](/talks/2012/concurrency.slide),
an introduction to Go's concurrency model.
Last week, at I/O 2013, Go team member Sameer Ajmani continued the story
with [_Advanced Go Concurrency Patterns_](http://go.dev/talks/2013/advconc.slide),
with [_Advanced Go Concurrency Patterns_](/talks/2013/advconc.slide),
an in-depth look at a real concurrent programming problem.
The talk shows how to detect and avoid deadlocks and race conditions,
and demonstrates the implementation of deadlines,
Expand All @@ -26,6 +26,6 @@ For those who want to take their Go programming to the next level, this is a mus
The slides are [available here](/talks/2013/advconc.slide)
(use the left and right arrows to navigate).

The slides were produced with [the present tool](https://godoc.org/golang.org/x/tools/present),
and the runnable code snippets are powered by the [Go Playground](http://play.golang.org/).
The slides were produced with [the present tool](https://pkg.go.dev/golang.org/x/tools/present),
and the runnable code snippets are powered by the [Go Playground](/play/).
The source code for this talk is in [the go.talks sub-repository](https://github.com/golang/talks/tree/master/content/2013/advconc).
2 changes: 1 addition & 1 deletion _content/blog/new-talk-and-tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and how Go addresses those problems.
You can view [a video stream of the talk](https://www.youtube.com/watch?v=7VcArS4Wpqk),
and [download the slides](http://www.stanford.edu/class/ee380/Abstracts/100428-pike-stanford.pdf).

Last week's release included a code lab, [Writing Web Applications](/doc/codelab/wiki/),
Last week's release included a code lab, [Writing Web Applications](/doc/articles/wiki/),
that details the construction of a simple wiki program.
It is a practical introduction to some fundamental Go concepts,
and the first of a series of Go code labs.
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/pandemic.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ the [Gophers slack](https://gophers.slack.com)
## Online Training

The Go trainers you meet at conferences also travel the globe doing
[in-person training](https://learn.go.dev/)
[in-person training](/learn/)
for companies that want help adopting Go.
That in-person teaching is crucial to bringing
new gophers into the community;
Expand Down
3 changes: 2 additions & 1 deletion _content/blog/pgo-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,5 @@ For much more information on using PGO, best practices and caveats to be aware o

Please send us your feedback!
PGO is still in preview and we'd love to hear about anything that is difficult to use, doesn't work correctly, etc.
Please file issues at https://go.dev/issue/new.
Please file issues at [go.dev/issue/new](/issue/new).

2 changes: 1 addition & 1 deletion _content/blog/race-detector.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Here the main goroutine is wholly responsible for setting and resetting the
a thread-safe way.

A simpler but less efficient approach is to
[avoid reusing timers](http://play.golang.org/p/kuWTrY0pS4).
[avoid reusing timers](/play/p/kuWTrY0pS4).

### Example 2: ioutil.Discard

Expand Down
2 changes: 1 addition & 1 deletion _content/blog/survey2023-h2-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ external research like [Stack Overflow's Developer
Survey](https://survey.stackoverflow.co/2023/#most-popular-technologies-language-prof)
(which found 14% of professional developers worked with Go during the past
year, a roughly 15% year-over-year increase), as well as analytics for
[go.dev](https://go.dev) (which show an 8% rise in visitors year-over-year).
[go.dev](/) (which show an 8% rise in visitors year-over-year).
Combining this growth with a high satisfaction score is evidence that Go
continues to appeal to developers, and suggests that many developers who
choose to learn the language feel good about their decision long afterwards.
Expand Down
4 changes: 2 additions & 2 deletions _content/blog/turkey-doodle.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Here's the code for the request handler with explanatory comments:
{{raw `
<pre>
func handler(w http.ResponseWriter, r *http.Request) {
// <a href="https://blog.golang.org/2010/08/defer-panic-and-recover.html">Defer</a> a function to recover from any panics.
// <a href="/blog/defer-panic-and-recover.html">Defer</a> a function to recover from any panics.
// When recovering from a panic, log the error condition to
// the App Engine dashboard and send the default image to the user.
defer func() {
Expand Down Expand Up @@ -273,7 +273,7 @@ making it easier to learn good style and conventions.
In writing this application I used just three resources:
App Engine's [Hello World Go example](http://code.google.com/appengine/docs/go/gettingstarted/helloworld.html),
[the Go packages documentation](/pkg/),
and [a blog post showcasing the Draw package](/blog/2011/09/go-imagedraw-package.html).
and [a blog post showcasing the Draw package](/blog/go-imagedraw-package).
Thanks to the rapid iteration made possible by the development server and
the language itself,
I was able to pick up the language and build a super fast,
Expand Down
2 changes: 1 addition & 1 deletion _content/blog/two-recent-go-articles.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In today's blog post I'd like to highlight a couple of recent articles about Go.
In October last year, Rob Pike presented a keynote at the ACM [SPLASH](http://splashcon.org/2012/) conference in Tucson.
The talk, titled [Go at Google](/talks/2012/splash.slide),
was a comprehensive discussion of the motivations behind Go.
Rob later expanded on his talk to produce an essay titled [Go at Google: Language Design in the Service of Software Engineering](http://go.dev/talks/2012/splash.article).
Rob later expanded on his talk to produce an essay titled [Go at Google: Language Design in the Service of Software Engineering](/talks/2012/splash.article).
Here is the abstract:

The Go programming language was conceived in late 2007 as an
Expand Down
8 changes: 4 additions & 4 deletions _content/blog/vuln.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ We encourage package maintainers to [contribute](/s/vulndb-report-new)
information about public vulnerabilities in their own projects and [update](/s/vulndb-report-feedback)
existing information about vulnerabilities in their Go packages.
We aim to make reporting a low friction process,
so please [send us your suggestions](https://golang.org/s/vuln-feedback) for
so please [send us your suggestions](/s/vuln-feedback) for
any improvements.

The Go vulnerability database can be viewed in your browser at [pkg.go.dev/vuln](https://pkg.go.dev/vuln).
Expand Down Expand Up @@ -93,12 +93,12 @@ You should expect some bugs and [limitations](https://pkg.go.dev/golang.org/x/vu
We would love for you to contribute and help us make improvements in the
following ways:

- [Contribute new](https://golang.org/s/vulndb-report-new) and
- [Contribute new](/s/vulndb-report-new) and
[update existing](/s/vulndb-report-feedback) information about
public vulnerabilities for Go packages that you maintain
- [Take this survey](https://golang.org/s/govulncheck-feedback) to share your
- [Take this survey](/s/govulncheck-feedback) to share your
experience using govulncheck
- [Send us feedback](https://golang.org/s/vuln-feedback) about issues and
- [Send us feedback](/s/vuln-feedback) about issues and
feature requests

We are excited to work with you to build a better and more secure Go ecosystem.
Loading

0 comments on commit 0a7f378

Please sign in to comment.