Skip to content

cmd/go: "go env GOTELEMETRY" should not be an alias of "go telemetry" #68936

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

Closed
zigo101 opened this issue Aug 19, 2024 · 7 comments
Closed

cmd/go: "go env GOTELEMETRY" should not be an alias of "go telemetry" #68936

zigo101 opened this issue Aug 19, 2024 · 7 comments

Comments

@zigo101
Copy link

zigo101 commented Aug 19, 2024

Go version

go version go1.23.0 linux/amd64

Output of go env in your module/workspace:

.

What did you do?

$ go env GOTELEMETRY
off
$ go telemetry
off
$ go env -changed
GOSUMDB='off'
GOTOOLCHAIN='local'
GCCGO='/usr/bin/gccgo'

What did you see happen?

go env treats GOTELEMETRY as env var.

What did you expect to see?

go env sometimes treats GOTELEMETRY as env var, sometimes not. It is confused.

Consistency is important. go env and go env -changed should have the same attitude.

Related: #68930

@seankhliao
Copy link
Member

go env already reports various unsettable settings for debugging purposes such as GOVERSION, GOMOD, GOWORK in addition to GOTELEMETRY. It is quite useful for troubleshooting issues.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2024
@zigo101
Copy link
Author

zigo101 commented Aug 19, 2024

It is reasonable that go env -changed doesn't include GOVERSION, GOMOD and GOWORK (they either have not a default value or not changeable).

But the value of GOTELEMETRY is configurable and it has a default value. If is confused that if is not reported by go env -changed when it isn't default.

@seankhliao
Copy link
Member

GOTELEMETRY is not configurable, it's a separate setting set form $user_config_dir/go/telemetry/mode

@zigo101
Copy link
Author

zigo101 commented Aug 19, 2024

$ go telemetry local
$ go env GOTELEMETRY
local
$ go telemetry off
$ go env GOTELEMETRY
off

@ianlancetaylor
Copy link
Contributor

@zigo101 It sounds like you are saying that the bug here is that go env -changed GOTELEMETRY does not correctly report that GOTELEMETRY has changed after someone runs a command like go telemetry on. Is that correct?

The bug title is that go env GOTELEMETRY should not be an alias of "go telemetry"`, but I don't see any obvious reason that that is buggy.

If I've misunderstood, can you show a sequence of commands that demonstrates a problem? I don't see any problem in the original post or in #68936 (comment). Thanks.

@zigo101
Copy link
Author

zigo101 commented Aug 20, 2024

If is just that the value of the env var of GOTELEMETRY is user configed, but when it is not the default value, it is not listed in go env -changed. That is werid. So either remove this env var or fix go env -changed will remove the weirdness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants