Skip to content

Commit b3c50d1

Browse files
committed
content: fix links to code.google.com
Some minor fixes and clean up to articles that referred to code.google.com (now defunct). This cleans up all of the top 30 articles (not much point in cleaning up the articles that are less viewed). Fixes golang/go#18907. Change-Id: I38a22f57e1effa8a545b429dface088042df0f91 Reviewed-on: https://go-review.googlesource.com/36311 Reviewed-by: Russ Cox <[email protected]>
1 parent 788e278 commit b3c50d1

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

content/c-go-cgo.article

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,4 @@ To build cgo packages, just use [[http://golang.org/cmd/go/#Compile_packages_and
104104

105105
The [[http://golang.org/cmd/cgo/][cgo command]] documentation has more detail about the C pseudo-package and the build process. The [[http://golang.org/misc/cgo/][cgo examples]] in the Go tree demonstrate more advanced concepts.
106106

107-
For a simple, idiomatic example of a cgo-based package, see Russ Cox's [[http://code.google.com/p/gosqlite/source/browse/sqlite/sqlite.go][gosqlite]]. Also, the Go Project Dashboard lists [[https://godashboard.appspot.com/project?tag=cgo][several other cgo packages]].
108-
109107
Finally, if you're curious as to how all this works internally, take a look at the introductory comment of the runtime package's [[https://golang.org/src/runtime/cgocall.go][cgocall.go]].

content/error-handling-and-go.article

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Client code can test for a `net.Error` with a type assertion and then distinguis
131131

132132
In Go, error handling is important. The language's design and conventions encourage you to explicitly check for errors where they occur (as distinct from the convention in other languages of throwing exceptions and sometimes catching them). In some cases this makes Go code verbose, but fortunately there are some techniques you can use to minimize repetitive error handling.
133133

134-
Consider an [[http://code.google.com/appengine/docs/go/][App Engine]] application with an HTTP handler that retrieves a record from the datastore and formats it with a template.
134+
Consider an [[https://cloud.google.com/appengine/docs/go/][App Engine]] application with an HTTP handler that retrieves a record from the datastore and formats it with a template.
135135

136136
func init() {
137137
http.HandleFunc("/view", viewRecord)

content/go-fmt-your-code.article

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The easiest way to mechanically manipulate Go code is with gofmt's -r flag. The
5252

5353
where both pattern and replacement are valid Go expressions. In the pattern, single-character lowercase identifiers serve as wildcards matching arbitrary sub-expressions, and those expressions are substituted for the same identifiers in the replacement.
5454

55-
For example, this[[https://code.google.com/p/go/source/detail?r=ae4e014e0b77][ recent change]] to the Go core rewrote some uses of [[http://golang.org/pkg/bytes/#Compare][bytes.Compare]] to use the more efficient [[http://golang.org/pkg/bytes/#Equal][bytes.Equal]]. The contributor made the change using just two gofmt invocations:
55+
For example, this[[https://golang.org/cl/7038051][ recent change]] to the Go core rewrote some uses of [[http://golang.org/pkg/bytes/#Compare][bytes.Compare]] to use the more efficient [[http://golang.org/pkg/bytes/#Equal][bytes.Equal]]. The contributor made the change using just two gofmt invocations:
5656

5757
gofmt -r 'bytes.Compare(a, b) == 0 -> bytes.Equal(a, b)'
5858
gofmt -r 'bytes.Compare(a, b) != 0 -> !bytes.Equal(a, b)'

content/organizing-go-code.article

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A good name is the most important part of a software interface: the name is the
2222

2323
An import path is the string with which users import a package. It specifies the directory (relative to `$GOROOT/src/pkg` or `$GOPATH/src`) in which the package's source code resides.
2424

25-
Import paths should be globally unique, so use the path of your source repository as its base. For instance, the `websocket` package from the `go.net` sub-repository has an import path of `"golang.org/x/net/websocket"`. The Go project owns the path `"code.google.com/p/go"`, so that path cannot be used by another author for a different package. Because the repository URL and import path are one and the same, the `go`get` command can fetch and install the package automatically.
25+
Import paths should be globally unique, so use the path of your source repository as its base. For instance, the `websocket` package from the `go.net` sub-repository has an import path of `"golang.org/x/net/websocket"`. The Go project owns the path `"github.com/golang"`, so that path cannot be used by another author for a different package. Because the repository URL and import path are one and the same, the `go`get` command can fetch and install the package automatically.
2626

2727
If you don't use a hosted source repository, choose some unique prefix such as a domain, company, or project name. As an example, the import path of all Google's internal Go code starts with the string `"google"`.
2828

content/package-names.article

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Just as types in different packages can have the same name without ambiguity,
150150
packages in different directories can have the same name.
151151
For example,
152152
[[https://golang.org/pkg/runtime/pprof][runtime/pprof]] provides profiling data
153-
in the format expected by the [[https://code.google.com/p/gperftools][pprof]]
153+
in the format expected by the [[https://github.com/google/pprof][pprof]]
154154
profiling tool, while [[https://golang.org/pkg/net/http/pprof][net/http/pprof]]
155155
provides HTTP endpoints to present profiling data in this format.
156156
Client code uses the package path to import the package, so there is no

content/race-detector.article

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ It is currently available for Linux, OS X, and Windows systems
2222
with 64-bit x86 processors.
2323

2424
The race detector is based on the C/C++
25-
[[https://code.google.com/p/thread-sanitizer/][ThreadSanitizer runtime library]],
25+
[[https://github.com/google/sanitizers][ThreadSanitizer runtime library]],
2626
which has been used to detect many errors in Google's internal code base and in
2727
[[http://www.chromium.org/][Chromium]].
2828
The technology was integrated with Go in September 2012; since then it has detected
29-
[[https://code.google.com/p/go/issues/list?can=1&q=ThreadSanitizer][42 races]]
29+
[[https://github.com/golang/go/issues?utf8=%E2%9C%93&q=ThreadSanitizer][42 races]]
3030
in the standard library. It is now part of our continuous build process,
3131
where it continues to catch race conditions as they arise.
3232

@@ -37,7 +37,7 @@ The race detector is integrated with the go tool chain. When the
3737
with code that records when and how the memory was accessed, while the runtime
3838
library watches for unsynchronized accesses to shared variables.
3939
When such "racy" behavior is detected, a warning is printed.
40-
(See [[https://code.google.com/p/thread-sanitizer/wiki/Algorithm][this article]]
40+
(See [[https://github.com/google/sanitizers/wiki/ThreadSanitizerAlgorithm][this article]]
4141
for the details of the algorithm.)
4242

4343
Because of its design, the race detector can detect race conditions only when
@@ -165,22 +165,22 @@ is delegated to this potentially more efficient call:
165165
writer.ReadFrom(reader)
166166

167167
We
168-
[[https://code.google.com/p/go/source/detail?r=13faa632ba3a#][added a ReadFrom method]]
168+
[[https://golang.org/cl/4817041][added a ReadFrom method]]
169169
to Discard's underlying type, which has an internal buffer that is shared
170170
between all its users.
171171
We knew this was theoretically a race condition, but since all writes to the
172172
buffer should be thrown away we didn't think it was important.
173173

174174
When the race detector was implemented it immediately
175-
[[https://code.google.com/p/go/issues/detail?id=3970][flagged this code]] as racy.
175+
[[https://golang.org/issue/3970][flagged this code]] as racy.
176176
Again, we considered that the code might be problematic, but decided that the
177177
race condition wasn't "real".
178178
To avoid the "false positive" in our build we implemented
179-
[[https://code.google.com/p/go/source/detail?r=1e55cf10aa4f][a non-racy version]]
179+
[[https://golang.org/cl/6624059][a non-racy version]]
180180
that is enabled only when the race detector is running.
181181

182-
But a few months later [[http://bradfitz.com/][Brad]] encountered a
183-
[[https://code.google.com/p/go/issues/detail?id=4589][frustrating and strange bug]].
182+
But a few months later [[https://bradfitz.com/][Brad]] encountered a
183+
[[https://golang.org/issue/4589][frustrating and strange bug]].
184184
After a few days of debugging, he narrowed it down to a real race condition
185185
caused by `ioutil.Discard`.
186186

@@ -232,7 +232,7 @@ No errors or panics occurred, but the hashes were wrong. Nasty!
232232
}
233233

234234
The bug was finally
235-
[[https://code.google.com/p/go/source/detail?r=4b61f121966b][fixed]]
235+
[[https://golang.org/cl/7011047][fixed]]
236236
by giving a unique buffer to each use of `ioutil.Discard`, eliminating the race
237237
condition on the shared buffer.
238238

0 commit comments

Comments
 (0)