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 env GOTOOLCHAIN prints superfluous trailing newline #60361

Closed
zephyr opened this issue May 23, 2023 · 2 comments
Closed

cmd/go: go env GOTOOLCHAIN prints superfluous trailing newline #60361

zephyr opened this issue May 23, 2023 · 2 comments
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@zephyr
Copy link

zephyr commented May 23, 2023

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

$ go version
go version devel go1.21-e4e8f9b8ff 2023-05-23 04:38:43 +0000 linux/amd64

Does this issue reproduce with the latest release?

No, because GOTOOLCHAIN is new in go1.21.

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

go env Output
$ go env
GO111MODULE=''
GOARCH='amd64'
GOBIN='/home/dennis/bin/binaries-golang'
GOCACHE='/home/dennis/.cache/go-build'
GOENV='/home/dennis/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/dennis/.local/share/gopath/pkg/mod'
GONOPROXY='bitbucket.org/zephyr'
GONOSUMDB='bitbucket.org/zephyr'
GOOS='linux'
GOPATH='/home/dennis/.local/share/gopath'
GOPRIVATE='bitbucket.org/zephyr'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/golang/master'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLDIR='/opt/golang/master/pkg/tool/linux_amd64'
GOVCS='*:git'
GOVERSION='devel go1.21-e4e8f9b8ff 2023-05-23 04:38:43 +0000'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3637338098=/tmp/go-build -gno-record-gcc-switches'
GOROOT/bin/go version: go version devel go1.21-e4e8f9b8ff 2023-05-23 04:38:43 +0000 linux/amd64
GOROOT/bin/go tool compile -V: compile version devel go1.21-e4e8f9b8ff 2023-05-23 04:38:43 +0000
uname -sr: Linux 5.10.0-22-amd64
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Debian GLIBC 2.31-13+deb11u6) stable release version 2.31.

What did you do?

After reading #57001:

$ go env -w GOTOOLCHAIN=local
$ go env GOTOOLCHAIN
$ go env --json GOTOOLCHAIN

What did you expect to see?

local
{
	"GOTOOLCHAIN": "local"
}

What did you see instead?

local

{
	"GOTOOLCHAIN": "local\n"
}
@ianlancetaylor
Copy link
Contributor

CC @bcmills @rsc

@ianlancetaylor ianlancetaylor added the GoCommand cmd/go label May 23, 2023
@gopherbot
Copy link

Change https://go.dev/cl/497437 mentions this issue: cmd/go: set default GOTOOLCHAIN in GOROOT/go.env

@dmitshur dmitshur added this to the Go1.21 milestone May 24, 2023
@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants