The documentation at https://golang.org/cmd/go/#hdr-Environment_variables doesn't mention that GOENV=off is a special case for disabling the use of a Go environment configuration file. It probably should, and maybe to mention GOENV=./off is a workaround if they actually want to use a file named "off" in the current directory.
The text was updated successfully, but these errors were encountered:
I think the reason why GOENV=off go env GOENV prints a newline instead of 'off' is that in EnvFile we handle this case by returning an empty string and an error; the empty string is eventually printed out and the error is discarded during the go env invocation.
I'm not the best person to point out if this is a bug or not, but for my 2¢, a) the fact that it returns an empty string is utilized in updateEnvFile, and b) returning off instead of this empty string would be weird (returning both a valid value and an error), so to me, the current implementation feels okay.
I can drop a small documentation CL for this; hopefully it's innocuous enough to fit in this cycle.
The documentation at https://golang.org/cmd/go/#hdr-Environment_variables doesn't mention that
GOENV=off
is a special case for disabling the use of a Go environment configuration file. It probably should, and maybe to mentionGOENV=./off
is a workaround if they actually want to use a file named "off" in the current directory.The text was updated successfully, but these errors were encountered: