From 0a7f3785817805ba0861a5d107ffb23bd2c1ebea Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 7 Dec 2023 13:07:31 -0500 Subject: [PATCH] cmd/golangorg: check for invalid or broken links in served HTML 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 Reviewed-by: Dmitri Shuralyov Auto-Submit: Russ Cox LUCI-TryBot-Result: Go LUCI --- _content/blog/1year.md | 8 +- _content/blog/2years.md | 8 +- _content/blog/3years.md | 10 +- _content/blog/appengine-scalable.md | 2 +- _content/blog/debug-gdb.md | 2 +- _content/blog/generics-next-step.md | 2 +- _content/blog/gif-decoder.md | 2 +- _content/blog/go1.18beta2.md | 2 +- _content/blog/go1.7.md | 2 +- _content/blog/go12.md | 2 +- _content/blog/gob.md | 2 +- _content/blog/hello-china.md | 2 +- _content/blog/heroku.md | 2 +- _content/blog/introducing-gofix.md | 2 +- _content/blog/io2011.md | 6 +- _content/blog/io2013-talk-concurrency.md | 6 +- _content/blog/new-talk-and-tutorials.md | 2 +- _content/blog/pandemic.md | 2 +- _content/blog/pgo-preview.md | 3 +- _content/blog/race-detector.md | 2 +- _content/blog/survey2023-h2-results.md | 2 +- _content/blog/turkey-doodle.md | 4 +- _content/blog/two-recent-go-articles.md | 2 +- _content/blog/vuln.md | 8 +- _content/doc/articles/race_detector.html | 14 +- _content/doc/articles/wiki/index.html | 2 +- _content/doc/build-cover.md | 12 +- _content/doc/devel/pre_go1.html | 2 +- _content/doc/devel/weekly.html | 14 +- _content/doc/effective_go.html | 4 +- _content/doc/faq.html | 18 +- _content/doc/go1.18.md | 14 +- _content/doc/go1.2.md | 2 +- _content/doc/go1.20.md | 2 +- _content/doc/go1.7.md | 2 +- _content/doc/go1.8.md | 4 +- _content/doc/gopher/README | 2 +- _content/doc/install.html | 2 +- _content/doc/pgo.md | 8 +- _content/doc/security/fuzz/index.md | 4 +- _content/doc/security/vuln/editor.md | 4 +- _content/doc/security/vuln/index.md | 8 +- _content/doc/tutorial/generics.md | 2 +- _content/doc/tutorial/govulncheck.md | 2 +- _content/help.md | 2 +- _content/ref/mod.md | 6 +- _content/solutions/cloud.md | 2 +- _content/talks/2010/go_talk-20100112.html | 78 +++--- _content/talks/2010/go_talk-20100121.html | 100 ++++---- _content/talks/2012/go-docs.slide | 2 +- _content/talks/2014/go1.3.slide | 6 +- _content/talks/2014/playground.slide | 12 +- _content/talks/2014/taste.slide | 3 +- .../talks/2015/go-for-java-programmers.slide | 2 +- _content/talks/2015/gotham-grpc.slide | 4 +- _content/talks/2016/applicative.slide | 2 +- _content/talks/2017/state-of-go-may.slide | 2 +- .../2019/playground-v3/playground-v3.slide | 4 +- _content/tour/basics.article | 2 +- cmd/golangorg/server_test.go | 237 ++++++++++++++++-- 60 files changed, 436 insertions(+), 235 deletions(-) diff --git a/_content/blog/1year.md b/_content/blog/1year.md index dcf08e2432..7b08af671d 100644 --- a/_content/blog/1year.md +++ b/_content/blog/1year.md @@ -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/). @@ -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. @@ -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. @@ -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. diff --git a/_content/blog/2years.md b/_content/blog/2years.md index a7d5fb2ed3..f2fad7289a 100644 --- a/_content/blog/2years.md +++ b/_content/blog/2years.md @@ -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 @@ -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. @@ -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/). diff --git a/_content/blog/3years.md b/_content/blog/3years.md index ac077ee629..7a912d321f 100644 --- a/_content/blog/3years.md +++ b/_content/blog/3years.md @@ -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. @@ -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. @@ -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). diff --git a/_content/blog/appengine-scalable.md b/_content/blog/appengine-scalable.md index 16c42031d7..44b7c78289 100644 --- a/_content/blog/appengine-scalable.md +++ b/_content/blog/appengine-scalable.md @@ -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. diff --git a/_content/blog/debug-gdb.md b/_content/blog/debug-gdb.md index a98e5feff4..b635d51565 100644 --- a/_content/blog/debug-gdb.md +++ b/_content/blog/debug-gdb.md @@ -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. diff --git a/_content/blog/generics-next-step.md b/_content/blog/generics-next-step.md index d6ee26856d..d82043e4bb 100644 --- a/_content/blog/generics-next-step.md +++ b/_content/blog/generics-next-step.md @@ -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 diff --git a/_content/blog/gif-decoder.md b/_content/blog/gif-decoder.md index 038423dc39..e82a11309f 100644 --- a/_content/blog/gif-decoder.md +++ b/_content/blog/gif-decoder.md @@ -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, diff --git a/_content/blog/go1.18beta2.md b/_content/blog/go1.18beta2.md index e81448cb56..d9c14024d3 100644 --- a/_content/blog/go1.18beta2.md +++ b/_content/blog/go1.18beta2.md @@ -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, diff --git a/_content/blog/go1.7.md b/_content/blog/go1.7.md index 29c8f61064..5cfbb525a5 100644 --- a/_content/blog/go1.7.md +++ b/_content/blog/go1.7.md @@ -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. diff --git a/_content/blog/go12.md b/_content/blog/go12.md index bac9c8d529..04faae489d 100644 --- a/_content/blog/go12.md +++ b/_content/blog/go12.md @@ -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 diff --git a/_content/blog/gob.md b/_content/blog/gob.md index 0df4bfaddd..374d417e50 100644 --- a/_content/blog/gob.md +++ b/_content/blog/gob.md @@ -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. diff --git a/_content/blog/hello-china.md b/_content/blog/hello-china.md index ce88c8789e..2b7a1b9bf4 100644 --- a/_content/blog/hello-china.md +++ b/_content/blog/hello-china.md @@ -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. diff --git a/_content/blog/heroku.md b/_content/blog/heroku.md index 86e9abbdb9..964b4cde9c 100644 --- a/_content/blog/heroku.md +++ b/_content/blog/heroku.md @@ -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 diff --git a/_content/blog/introducing-gofix.md b/_content/blog/introducing-gofix.md index 6b2a77f4e9..a86e85e055 100644 --- a/_content/blog/introducing-gofix.md +++ b/_content/blog/introducing-gofix.md @@ -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; diff --git a/_content/blog/io2011.md b/_content/blog/io2011.md index ddc5c1763d..0b6d711453 100644 --- a/_content/blog/io2011.md +++ b/_content/blog/io2011.md @@ -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) @@ -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! diff --git a/_content/blog/io2013-talk-concurrency.md b/_content/blog/io2013-talk-concurrency.md index 38b6ac57a1..66d4c21160 100644 --- a/_content/blog/io2013-talk-concurrency.md +++ b/_content/blog/io2013-talk-concurrency.md @@ -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, @@ -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). diff --git a/_content/blog/new-talk-and-tutorials.md b/_content/blog/new-talk-and-tutorials.md index 792a00441a..9f1de1e17a 100644 --- a/_content/blog/new-talk-and-tutorials.md +++ b/_content/blog/new-talk-and-tutorials.md @@ -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. diff --git a/_content/blog/pandemic.md b/_content/blog/pandemic.md index f72b8e871a..8371a6a01b 100644 --- a/_content/blog/pandemic.md +++ b/_content/blog/pandemic.md @@ -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; diff --git a/_content/blog/pgo-preview.md b/_content/blog/pgo-preview.md index 561d23477e..1e9270686a 100644 --- a/_content/blog/pgo-preview.md +++ b/_content/blog/pgo-preview.md @@ -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). + diff --git a/_content/blog/race-detector.md b/_content/blog/race-detector.md index d7d7065a72..ca8ecae962 100644 --- a/_content/blog/race-detector.md +++ b/_content/blog/race-detector.md @@ -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 diff --git a/_content/blog/survey2023-h2-results.md b/_content/blog/survey2023-h2-results.md index 27b8aed07d..ae30e510a5 100644 --- a/_content/blog/survey2023-h2-results.md +++ b/_content/blog/survey2023-h2-results.md @@ -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. diff --git a/_content/blog/turkey-doodle.md b/_content/blog/turkey-doodle.md index c95506543c..8d167b7559 100644 --- a/_content/blog/turkey-doodle.md +++ b/_content/blog/turkey-doodle.md @@ -181,7 +181,7 @@ Here's the code for the request handler with explanatory comments: {{raw `
 func handler(w http.ResponseWriter, r *http.Request) {
-    // Defer a function to recover from any panics.
+    // Defer 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() {
@@ -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,
diff --git a/_content/blog/two-recent-go-articles.md b/_content/blog/two-recent-go-articles.md
index b19507f792..032e718bce 100644
--- a/_content/blog/two-recent-go-articles.md
+++ b/_content/blog/two-recent-go-articles.md
@@ -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
diff --git a/_content/blog/vuln.md b/_content/blog/vuln.md
index 6f4829c77b..5c54d61727 100644
--- a/_content/blog/vuln.md
+++ b/_content/blog/vuln.md
@@ -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).
@@ -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.
diff --git a/_content/doc/articles/race_detector.html b/_content/doc/articles/race_detector.html
index 55523736e9..80f186c8bb 100644
--- a/_content/doc/articles/race_detector.html
+++ b/_content/doc/articles/race_detector.html
@@ -200,7 +200,7 @@ 

Race on loop counter

func main() { var wg sync.WaitGroup wg.Add(5) - for i := 0; i < 5; i++ { + for i := 0; i < 5; i++ { go func() { fmt.Println(i) // Not the 'i' you are looking for. wg.Done() @@ -221,7 +221,7 @@

Race on loop counter

func main() { var wg sync.WaitGroup wg.Add(5) - for i := 0; i < 5; i++ { + for i := 0; i < 5; i++ { go func(j int) { fmt.Println(j) // Good. Read local copy of the loop counter. wg.Done() @@ -336,7 +336,7 @@

Primitive unprotected variable

for { time.Sleep(time.Second) // Second conflicting access. - if w.last < time.Now().Add(-10*time.Second).UnixNano() { + if w.last < time.Now().Add(-10*time.Second).UnixNano() { fmt.Println("No keepalives for 10 seconds. Dying.") os.Exit(1) } @@ -369,7 +369,7 @@

Primitive unprotected variable

go func() { for { time.Sleep(time.Second) - if atomic.LoadInt64(&w.last) < time.Now().Add(-10*time.Second).UnixNano() { + if atomic.LoadInt64(&w.last) < time.Now().Add(-10*time.Second).UnixNano() { fmt.Println("No keepalives for 10 seconds. Dying.") os.Exit(1) } @@ -391,7 +391,7 @@

Unsynchronized send and close // The race detector cannot derive the happens before relation // for the following send and close operations. These two operations // are unsynchronized and happen concurrently. -go func() { c <- struct{}{} }() +go func() { c <- struct{}{} }() close(c)

@@ -405,8 +405,8 @@

Unsynchronized send and close
 c := make(chan struct{}) // or buffered channel
 
-go func() { c <- struct{}{} }()
-<-c
+go func() { c <- struct{}{} }()
+<-c
 close(c)
 
diff --git a/_content/doc/articles/wiki/index.html b/_content/doc/articles/wiki/index.html index 4a447eabd5..b2536f6341 100644 --- a/_content/doc/articles/wiki/index.html +++ b/_content/doc/articles/wiki/index.html @@ -412,7 +412,7 @@

The html/template package

The html/template package helps guarantee that only safe and correct-looking HTML is generated by template actions. For instance, it automatically escapes any greater than sign (>), replacing it -with &gt;, to make sure user data does not corrupt the form +with &gt;, to make sure user data does not corrupt the form HTML.

diff --git a/_content/doc/build-cover.md b/_content/doc/build-cover.md index 15a971bd6e..00f68b948d 100644 --- a/_content/doc/build-cover.md +++ b/_content/doc/build-cover.md @@ -34,7 +34,7 @@ The resulting binary can then be run using an environment variable setting to ca During a given "`go build -cover`" invocation, the Go command will select packages in the main module for coverage profiling; other packages that feed into the build (dependencies listed in go.mod, or packages that are part of the Go standard library) will not be included by default. -For example, here is a toy program containing a main package, a local main-module package `greetings` and a set of packages imported from outside the module, including (among others) `rsc.io/quote` and `fmt` ([link to full program](https://go.dev/play/p/VSQJN8xkkf-?v=gotip)). +For example, here is a toy program containing a main package, a local main-module package `greetings` and a set of packages imported from outside the module, including (among others) `rsc.io/quote` and `fmt` ([link to full program](/play/p/VSQJN8xkkf-?v=gotip)). ``` $ cat go.mod @@ -246,7 +246,7 @@ for coverage, but will not instrument imports outside the main module One way to request instrumentation for all non-stdlib dependencies is to feed the output of `go list` into `-coverpkg`. Here is an example, again using -the [example program](https://go.dev/play/p/VSQJN8xkkf-?v=gotip) cited above: +the [example program](/play/p/VSQJN8xkkf-?v=gotip) cited above: ``` $ go list -f '{{"{{if not .Standard}}{{.ImportPath}}{{end}}"}}' -deps . | paste -sd "," > pkgs.txt @@ -279,7 +279,7 @@ profile data from statements executed during the run will be lost. #### Will `-coverpkg=main` select my main package for profiling? {#mainpkg} -The `-coverpkg` flag accepts a list of import paths, not a list of package names. If you want to select your `main` package for coverage instrumention, please identify it by import path, not by name. Example (using [this example program](https://go.dev/play/p/VSQJN8xkkf-?v=gotip)): +The `-coverpkg` flag accepts a list of import paths, not a list of package names. If you want to select your `main` package for coverage instrumention, please identify it by import path, not by name. Example (using [this example program](/play/p/VSQJN8xkkf-?v=gotip)): ``` $ go list -m @@ -299,13 +299,13 @@ $ - **Blog post introducing unit test coverage in Go 1.2**: - Coverage profiling for unit tests was introduced as part of the - Go 1.2 release; see [this blog post](https://go.dev/blog/cover) for details. + Go 1.2 release; see [this blog post](/blog/cover) for details. - **Documentation**: - The [`cmd/go`](https://pkg.go.dev/cmd/go) package docs describe the build and test flags associated with coverage. - **Technical details**: - - [Design draft](https://go.googlesource.com/proposal/+/master/design/51430-revamp-code-coverage.md) - - [Proposal](https://golang.org/issue/51430) + - [Design draft](/design/51430-revamp-code-coverage) + - [Proposal](/issue/51430) ## Glossary {#glossary} diff --git a/_content/doc/devel/pre_go1.html b/_content/doc/devel/pre_go1.html index 43bd1e8a9e..ca1aceb1fe 100644 --- a/_content/doc/devel/pre_go1.html +++ b/_content/doc/devel/pre_go1.html @@ -316,7 +316,7 @@

r57 (released 2011/05/03)

Gofix can’t handle all situations perfectly, so read and test the changes it makes before committing them. -See the gofix blog post for more +See the gofix blog post for more information.

Language

diff --git a/_content/doc/devel/weekly.html b/_content/doc/devel/weekly.html index 7ff43d4a87..f1b7cd11fb 100644 --- a/_content/doc/devel/weekly.html +++ b/_content/doc/devel/weekly.html @@ -378,7 +378,7 @@

2012-03-04

make https DumpRequestOut less racy. * net/http: add overlooked 418 status code, per RFC 2324, fix ProxyFromEnvironment bug, docs, add tests, - make a test more paranoid & reliable on Windows. + make a test more paranoid & reliable on Windows. * net/rpc: silence read error on closing connection. * net: add stubs for NetBSD (thanks Benny Siegert), make -external flag for tests default to true (thanks Mikio Hara), @@ -615,7 +615,7 @@

2012-02-14

fix client goroutine leak with persistent connections, fix reference to URL.RawPath in docs (thanks Bjorn Tipling), panic on duplicate registrations, - use mtime < t+1s to check for unmodified (thanks Hong Ruiqi). + use mtime < t+1s to check for unmodified (thanks Hong Ruiqi). * net: avoid Shutdown during Close, avoid TCP self-connect, disable TestDialTimeout on Windows, @@ -708,7 +708,7 @@

2012-02-07

diagnose \ in import path, disallow switch _ := v.(type), don't print implicit type on struct literal in export, - fix codegen reordering for expressions involving && and ||, + fix codegen reordering for expressions involving && and ||, use octal escapes in mkopnames (thanks Anthony Martin). use original constant expression in error messages (thanks Rémy Oudompheng). * cmd/go: add support for release tags via git branches (thanks Gustavo Niemeyer), @@ -885,7 +885,7 @@

2012-01-27

* 6c, 8c: make floating point code NaN-safe. * 6l, 8l: remove unused macro definition (thanks Shenghou Ma). * archive/tar: fix race in TestNonSeekable. -* archive/zip: add functions to convert between os.FileInfo & FileHeader. +* archive/zip: add functions to convert between os.FileInfo & FileHeader. * build: do not build all C compilers (thanks Shenghou Ma), remove code now in subrepositories. * bytes: remove dead code, complete documentation, @@ -1603,7 +1603,7 @@

2011-12-01

* runtime: make sure stack is 16-byte aligned on syscall (thanks Alex Brainman). * spec, gc: allow direct conversion between string and named []byte, []rune. * sql: add Tx.Stmt to use an existing prepared stmt in a transaction, - more driver docs & tests; no functional changes. + more driver docs & tests; no functional changes. * strings: add ContainsAny and ContainsRune (thanks Scott Lawrence). * syscall: add SUSv3 RLIMIT/RUSAGE constants (thanks Sébastien Paolacci), fix openbsd sysctl hostname/domainname workaround, @@ -2343,7 +2343,7 @@

2011-09-01

adjustments to filter function. fix ast.MergePackageFiles to collect infos about imports. (thanks Sebastien Binet) generalize ast.FilterFile. -* go/build: add test support & use in gotest. +* go/build: add test support & use in gotest. separate test imports out when scanning. (thanks Gustavo Niemeyer) * go/parser: fix type switch scoping. fix type switch scoping. @@ -2692,7 +2692,7 @@

2011-07-19

* json: add omitempty struct tag option, allow using '$' and '-' as the struct field's tag (thanks Mikio Hara), encode \r and \n in strings as e.g. "\n", not "\u000A" (thanks Evan Martin), - escape < and > in any JSON string for XSS prevention. + escape < and > in any JSON string for XSS prevention. * ld: allow seek within write buffer< add a PT_LOAD PHDR entry for the PHDR (thanks David Anderson). * net: windows/amd64 port (thanks Wei Guangjing). diff --git a/_content/doc/effective_go.html b/_content/doc/effective_go.html index 2e6509f2fd..60895897ed 100644 --- a/_content/doc/effective_go.html +++ b/_content/doc/effective_go.html @@ -62,7 +62,7 @@

Examples

use the language. Moreover, many of the packages contain working, self-contained executable examples you can run directly from the -golang.org web site, such as +go.dev web site, such as this one (if necessary, click on the word "Example" to open it up). If you have a question about how to approach a problem or how something @@ -3098,7 +3098,7 @@

Parallelization

to structure as parallel computations, Go is a concurrent language, not a parallel one, and not all parallelization problems fit Go's model. For a discussion of the distinction, see the talk cited in -this +this blog post.

A leaky buffer

diff --git a/_content/doc/faq.html b/_content/doc/faq.html index 136b325e63..11388ad757 100644 --- a/_content/doc/faq.html +++ b/_content/doc/faq.html @@ -230,15 +230,7 @@

Yes. Go is used widely in production inside Google. -One easy example is the server behind -golang.org. -It's just the godoc -document server running in a production configuration on -Google App Engine. -

- -

-A more significant instance is Google's download server, dl.google.com, +One example is Google's download server, dl.google.com, which delivers Chrome binaries and other large installables such as apt-get packages.

@@ -1626,7 +1618,7 @@

See the Share Memory By Communicating code walk -and its +and its associated article for a detailed discussion of this concept.

@@ -1665,7 +1657,7 @@

For more detail on this topic see the talk entitled -Concurrency +Concurrency is not Parallelism.

@@ -2506,7 +2498,7 @@

There has been significant improvement in the performance of many programs as the language and tools have developed. See the blog post about -profiling +profiling Go programs for an informative example.

Changes from C

@@ -2695,7 +2687,7 @@

is typical in garbage-collected languages. A careful programmer can reduce the garbage collection overhead dramatically by using the language well; see the article about -profiling +profiling Go programs for a worked example, including a demonstration of Go's profiling tools.

diff --git a/_content/doc/go1.18.md b/_content/doc/go1.18.md index 5d745cb1c2..55c8f8e598 100644 --- a/_content/doc/go1.18.md +++ b/_content/doc/go1.18.md @@ -157,7 +157,7 @@ up with these language changes. The Go 1.18 compiler now correctly reports `declared but not used` errors for variables that are set inside a function literal but are never used. Before Go 1.18, the compiler did not report an error in such cases. This fixes long-outstanding compiler -issue [#8560](https://golang.org/issue/8560). As a result of this change, +issue [#8560](/issue/8560). As a result of this change, (possibly incorrect) programs may not compile anymore. The necessary fix is straightforward: fix the program if it was in fact incorrect, or use the offending variable, for instance by assigning it to the blank identifier `_`. @@ -185,7 +185,7 @@ a minimum target version of the AMD64 architecture. Allowed values are `v1`, `v2`, `v3`, or `v4`. Each higher level requires, and takes advantage of, additional processor features. A detailed description can be found -[here](https://golang.org/wiki/MinimumRequirements#amd64). +[here](/wiki/MinimumRequirements#amd64). The `GOAMD64` environment variable defaults to `v1`. @@ -227,7 +227,7 @@ FreeBSD 13.0+ will require a kernel with the COMPAT\_FREEBSD12 option set (this ### Fuzzing {#fuzzing} Go 1.18 includes an implementation of fuzzing as described by -[the fuzzing proposal](https://golang.org/issue/44551). +[the fuzzing proposal](/issue/44551). See the [fuzzing landing page](/security/fuzz) to get started. @@ -250,8 +250,8 @@ adjusting dependencies in `go.mod`. Effectively, the `-d` flag is always enabled. To install the latest version of an executable outside the context of the current module, use [`go` -`install` `example.com/cmd@latest`](https://golang.org/ref/mod#go-install). Any -[version query](https://golang.org/ref/mod#version-queries) +`install` `example.com/cmd@latest`](/ref/mod#go-install). Any +[version query](/ref/mod#version-queries) may be used instead of `latest`. This form of `go` `install` was added in Go 1.16, so projects supporting older versions may need to provide install instructions for both `go` @@ -397,7 +397,7 @@ In Go 1.18, `go` `fix` now removes the now-obsolete `//` `+build` lines in modules declaring `go` `1.18` or later in their `go.mod` files. -For more information, see . +For more information, see [go.dev/design/draft-gobuild](/design/draft-gobuild). ### Gofmt {#gofmt} @@ -415,7 +415,7 @@ The `vet` tool is updated to support generic code. In most cases, it reports an error in generic code whenever it would report an error in the equivalent non-generic code after substituting for type parameters with a type from their -[type set](https://golang.org/ref/spec#Interface_types). +[type set](/ref/spec#Interface_types). For example, `vet` reports a format error in func Print[T ~int|~string](t T) { diff --git a/_content/doc/go1.2.md b/_content/doc/go1.2.md index 05c8593d52..6667c2bffa 100644 --- a/_content/doc/go1.2.md +++ b/_content/doc/go1.2.md @@ -162,7 +162,7 @@ _Updating_: Since godoc and vet are not part of the library, no client Go code depends on their source and no updating is required. -The binary distributions available from [golang.org](https://golang.org) +The binary distributions available from [golang.org](/) include these binaries, so users of these distributions are unaffected. When building from source, users must use "go get" to install godoc and vet. diff --git a/_content/doc/go1.20.md b/_content/doc/go1.20.md index a9873af356..a7601849e1 100644 --- a/_content/doc/go1.20.md +++ b/_content/doc/go1.20.md @@ -230,7 +230,7 @@ to an output directory for coverage profiles. See the ['coverage for integration tests' landing page](/testing/coverage) for more on how to get started. For details on the design and implementation, see the -[proposal](https://golang.org/issue/51430). +[proposal](/issue/51430). ### Vet {#vet} diff --git a/_content/doc/go1.7.md b/_content/doc/go1.7.md index 5f01bbcf20..7f4d652a99 100644 --- a/_content/doc/go1.7.md +++ b/_content/doc/go1.7.md @@ -124,7 +124,7 @@ generates more compact, more efficient code and provides a better platform for optimizations such as bounds check elimination. The new back end reduces the CPU time required by -[our benchmark programs](/test/bench/go1/) by 5-35%. +our benchmark programs by 5-35%. For this release, the new back end can be disabled by passing `-ssa=0` to the compiler. diff --git a/_content/doc/go1.8.md b/_content/doc/go1.8.md index 1f2fc6b306..ecf70252c1 100644 --- a/_content/doc/go1.8.md +++ b/_content/doc/go1.8.md @@ -260,7 +260,7 @@ generates more compact, more efficient code and provides a better platform for optimizations such as bounds check elimination. The new back end reduces the CPU time required by -[our benchmark programs](/test/bench/go1/) by 20-30% +our benchmark programs by 20-30% on 32-bit ARM systems. For 64-bit x86 systems, which already used the SSA back end in Go 1.7, the gains are a more modest 0-10%. Other architectures will likely see improvements closer to the 32-bit ARM numbers. @@ -627,7 +627,7 @@ The [`ClientHelloInfo`](/pkg/crypto/tls/#ClientHelloInfo) struct now has new fields `Conn`, `SignatureSchemes` (using the new -type [`SignatureScheme`](/kg/crypto/tls/#SignatureScheme)), +type [`SignatureScheme`](/pkg/crypto/tls/#SignatureScheme)), `SupportedProtos`, and `SupportedVersions`. diff --git a/_content/doc/gopher/README b/_content/doc/gopher/README index d4ca8a1c2d..15726465ad 100644 --- a/_content/doc/gopher/README +++ b/_content/doc/gopher/README @@ -1,3 +1,3 @@ The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/) The design is licensed under the Creative Commons 3.0 Attributions license. -Read this article for more details: https://blog.golang.org/gopher +Read this article for more details: https://go.dev/blog/gopher diff --git a/_content/doc/install.html b/_content/doc/install.html index 6ea21ec286..8f93e53d40 100644 --- a/_content/doc/install.html +++ b/_content/doc/install.html @@ -84,7 +84,7 @@

Go installation

(if it exists), then extract the archive you just downloaded into /usr/local, creating a fresh Go tree in /usr/local/go:
-      $ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
+      $ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz