Closed
Description
In https://golang.org/cl/126656, @rsc added the GOFLAGS
environment variable.
The variable is space-separated, but it is sometimes useful to include spaces within flags passed to the go command (for example, as the final argument to list -f
). It would be nice to recognize at least a subset of the usual quoting conventions when parsing GOFLAGS
.
~/go/src/cmd/go$ go list -e -deps -f="{{if .Error}}{{.Error}}{{end}}"
~/go/src/cmd/go$ export GOFLAGS='-e -deps -f="{{if .Error}}{{.Error}}{{end}}"'
~/go/src/cmd/go$ go list
go: parsing $GOFLAGS: non-flag ".Error}}{{.Error}}{{end}}\""