aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2012-03-26 17:47:39 +1100
committerRob Pike <r@golang.org>2012-03-26 17:47:39 +1100
commit6421bdeb71b3900b495535959259fbb24d83d407 (patch)
tree7e7e3b45d9f855baeae957d2194f6f5b71348159
parentbfdc45a456d5931e670f299ab7b4f68ecf570bff (diff)
downloadgo-6421bdeb71b3900b495535959259fbb24d83d407.tar.gz
go-6421bdeb71b3900b495535959259fbb24d83d407.zip
cmd/go: explain versions better
Summarize the desiderata for selecting versions of remote packages to get. Fixes #3394. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5902058
-rw-r--r--src/cmd/go/doc.go10
-rw-r--r--src/cmd/go/get.go10
2 files changed, 18 insertions, 2 deletions
diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go
index 775f305d2b..162eecfcc9 100644
--- a/src/cmd/go/doc.go
+++ b/src/cmd/go/doc.go
@@ -225,7 +225,15 @@ The -u flag instructs get to use the network to update the named packages
and their dependencies. By default, get uses the network to check out
missing packages but does not use it to look for updates to existing packages.
-TODO: Explain versions better.
+When checking out or updating a package, get looks for a branch or
+tag that matches the locally installed version of Go. If the local
+version "is release.rNN", it searches for "go.rNN". (For an
+installation using Go version "weekly.YYYY-MM-DD", it searches for a
+package version labeled "go.YYYY-MM-DD".) If the desired version
+cannot be found but others exist with labels in the correct format,
+get retrieves the most recent version before the desired label.
+Finally, if all else fails it retrieves the most recent version of
+the package.
For more about specifying packages, see 'go help packages'.
diff --git a/src/cmd/go/get.go b/src/cmd/go/get.go
index 5db1ff873b..c0788d30c6 100644
--- a/src/cmd/go/get.go
+++ b/src/cmd/go/get.go
@@ -36,7 +36,15 @@ The -u flag instructs get to use the network to update the named packages
and their dependencies. By default, get uses the network to check out
missing packages but does not use it to look for updates to existing packages.
-TODO: Explain versions better.
+When checking out or updating a package, get looks for a branch or
+tag that matches the locally installed version of Go. If the local
+version "is release.rNN", it searches for "go.rNN". (For an
+installation using Go version "weekly.YYYY-MM-DD", it searches for a
+package version labeled "go.YYYY-MM-DD".) If the desired version
+cannot be found but others exist with labels in the correct format,
+get retrieves the most recent version before the desired label.
+Finally, if all else fails it retrieves the most recent version of
+the package.
For more about specifying packages, see 'go help packages'.