You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
Fixesgolang/go#18907.
Change-Id: I38a22f57e1effa8a545b429dface088042df0f91
Reviewed-on: https://go-review.googlesource.com/36311
Reviewed-by: Russ Cox <[email protected]>
Copy file name to clipboardExpand all lines: content/c-go-cgo.article
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,4 @@ To build cgo packages, just use [[http://golang.org/cmd/go/#Compile_packages_and
104
104
105
105
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.
106
106
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
-
109
107
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]].
Copy file name to clipboardExpand all lines: content/error-handling-and-go.article
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ Client code can test for a `net.Error` with a type assertion and then distinguis
131
131
132
132
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.
133
133
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.
Copy file name to clipboardExpand all lines: content/go-fmt-your-code.article
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ The easiest way to mechanically manipulate Go code is with gofmt's -r flag. The
52
52
53
53
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.
54
54
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:
56
56
57
57
gofmt -r 'bytes.Compare(a, b) == 0 -> bytes.Equal(a, b)'
58
58
gofmt -r 'bytes.Compare(a, b) != 0 -> !bytes.Equal(a, b)'
Copy file name to clipboardExpand all lines: content/organizing-go-code.article
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ A good name is the most important part of a software interface: the name is the
22
22
23
23
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.
24
24
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.
26
26
27
27
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"`.
0 commit comments