func checkEnvWrite(key, val string) error {
switch key {
- case "GOEXE", "GOGCCFLAGS", "GOHOSTARCH", "GOHOSTOS", "GOMOD", "GOWORK", "GOTOOLDIR", "GOVERSION":
+ case "GOEXE", "GOGCCFLAGS", "GOHOSTARCH", "GOHOSTOS", "GOMOD", "GOWORK", "GOTOOLDIR", "GOVERSION", "GOTELEMETRY", "GOTELEMETRYDIR":
return fmt.Errorf("%s cannot be modified", key)
case "GOENV", "GODEBUG":
return fmt.Errorf("%s can only be set using the OS environment", key)
stdout 'GOTELEMETRY=''?on''?'
stdout 'GOTELEMETRYDIR=''?'$userconfig'[\\/]go[\\/]telemetry''?'
! go env -w GOTELEMETRY=off
-stderr '^go: unknown go command variable GOTELEMETRY$'
+stderr '^go: GOTELEMETRY cannot be modified$'
! go env -w GOTELEMETRYDIR=foo
-stderr '^go: unknown go command variable GOTELEMETRYDIR$'
\ No newline at end of file
+stderr '^go: GOTELEMETRYDIR cannot be modified$'
\ No newline at end of file