-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
What version of Go are you using (go version)?
$ go version go version devel go1.17-6edd573218 Tue Apr 27 11:55:52 2021 +0000 linux/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GO111MODULE="on" GOARCH="amd64" GOBIN="/home/manlio/.local/bin" GOCACHE="/home/manlio/.cache/go-build" GOENV="/home/manlio/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="*.local" GOMODCACHE="/home/manlio/.local/lib/go/pkg/mod" GONOPROXY="" GONOSUMDB="*.local" GOOS="linux" GOPATH="/home/manlio/.local/lib/go:/home/manlio/src/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/manlio/src/contrib/go/go.googlesource.com/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/manlio/src/contrib/go/go.googlesource.com/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="devel go1.17-6edd573218 Tue Apr 27 11:55:52 2021 +0000" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build955556188=/tmp/go-build -gno-record-gcc-switches" GOROOT/bin/go version: go version devel go1.17-6edd573218 Tue Apr 27 11:55:52 2021 +0000 linux/amd64 GOROOT/bin/go tool compile -V: compile version devel go1.17-82aae74cb5 Tue Apr 27 14:48:20 2021 +0200 uname -sr: Linux 5.11.16-arch1-1 /usr/lib/libc.so.6: GNU C Library (GNU libc) release release version 2.33. gdb --version: GNU gdb (GDB) 10.1
What did you do?
Currently, the implementation of the go bug command is a bit confusing.
go versionis obtained usingruntime.Versiongo envis obtained invokingos.Executable env, falling back toGOROOT/bin/go envgo envoutput is OS specific (UNIX, Windows and plan9), but it is not clear if using only UNIX output is possiblego versionis printed a second time, using the labelGOROOT/bin/go version, invokingGOROOT/bin/go env.
The code don't says why there is a second version printed; is it for compatibility reasons?
Another issue is that thegocommand invoked may be different from the one invoked in 2.
Is this the intended behavior?- The label
GOROOT/bin/go tool compilehas the same issues as 4.
Reactions are currently unavailable