Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go help get description potentially unclear #20320

Closed
xmudrii opened this issue May 10, 2017 · 1 comment
Closed

cmd/go: go help get description potentially unclear #20320

xmudrii opened this issue May 10, 2017 · 1 comment

Comments

@xmudrii
Copy link
Contributor

xmudrii commented May 10, 2017

What version of Go are you using (go version)?

go version go1.8.1 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/marko"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build257331046=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

go help get

What did you see?

usage: get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages]
...
When checking out or updating a package, get looks for a branch or tag
that matches the locally installed version of Go. The most important
rule is that if the local installation is running version "go1", get
searches for a branch or tag named "go1". If no such version exists it
retrieves the most recent version of the package.

...

The first is part is clear - it searches for "go1" branch/tag and if it finds it, go get will use it for obtaining sources.

The problematic part is at the end - If no such version exists it retrieves the most recent version of the package..

As far as I know, if go get can't find "go1" branch/tag, it will use project's default branch. However, docs (help pages) says otherwise.

I would like explanation on this, am I correct or are docs correct? If I'm correct, I guess it would be much better to say something along:

When checking out or updating a package, get looks for a branch or tag
that matches the locally installed version of Go. The most important
rule is that if the local installation is running version "go1", get
searches for a branch or tag named "go1". If no such branch or tag exists it
retrieves the default branch of the package.

In that case, changing it here should do the job and I can submit PR if needed/wanted -

searches for a branch or tag named "go1". If no such version exists it

Also, looking by the VCS code, it seems like it uses default branch (git's default behavior) - https://github.com/golang/go/blob/178307c3a72a9da3d731fecf354630761d6b246c/src/cmd/go/internal/get/vcs.go

@bradfitz bradfitz changed the title cmd/go docs: go help get description potentially unclear cmd/go: go help get description potentially unclear May 12, 2017
@bradfitz bradfitz added this to the Go1.9Maybe milestone May 12, 2017
@gopherbot
Copy link

CL https://golang.org/cl/45890 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants