diff options
author | Andrew Gerrand <adg@golang.org> | 2014-11-10 09:04:38 +1100 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2014-11-10 09:04:38 +1100 |
commit | 384d65407f6cb7c1f0e2ac194b4496cc817be4a4 (patch) | |
tree | a6b043600b8d3b6e1e68167be24b0adfb714047e /content/organizing-go-code.article | |
parent | 22c0c799956aad8e7f4d0ebe5f07701af56272a3 (diff) |
go.blog: use new golang.org/x/... import paths
TBR=rsc
R=rsc, r
CC=golang-codereviews
https://golang.org/cl/170250043
Diffstat (limited to 'content/organizing-go-code.article')
-rw-r--r-- | content/organizing-go-code.article | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/content/organizing-go-code.article b/content/organizing-go-code.article index 9eed04d..185034f 100644 --- a/content/organizing-go-code.article +++ b/content/organizing-go-code.article @@ -22,7 +22,7 @@ A good name is the most important part of a software interface: the name is the 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. -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 `"code.google.com/p/go.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. +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. 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"`. |