This happens with 'go env' and 'go bug'. If GOFLAGS variable is set to something like '=value', running `go env` panics with this error message: goroutine 1 [running]: cmd/go/internal/base.SetFromGOFLAGS(0xd96838) cmd/go/internal/base/goflags.go:101 +0x9a7 main.main() cmd/go/main.go:188 +0x755 This happens when the 'name' of the flag is not specified ('=' or '=value'), with any combination of other flags. Other commands show this error message: go: parsing $GOFLAGS: non-flag This happens only with 'env' and 'bug' because we have this: https://go.googlesource.com/go/+/refs/heads/master/src/cmd/go/internal/base/goflags.go#40 New behaviour: ignore the bad flag, since we don't want to report that with `go env` or `go bug`. Fixes: #42013 Change-Id: I72602840ca00293d2a92ea28451b75b9799e3d6c Reviewed-on: https://go-review.googlesource.com/c/go/+/263098 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Michael Matloob <matloob@golang.org>
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.