golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
120.68k stars 17.33k forks source link

Unknown go command variable GOTELEMETRY - how to disable telemetry? #67424

Closed TLINDEN closed 4 weeks ago

TLINDEN commented 4 weeks ago

Go version

go1.22.1

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/foo/.cache/go-build'
GOENV='/home/foo/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/foo/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/foo/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go1.22.1.linux-amd64'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go1.22.1.linux-amd64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build24553183=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I've read this issue which links to this telemetry paper, which says, that in order to completely disable telemetry I have to execute go env -w GOTELEMETRY=off.

What did you see happen?

When I do, I get:

go env -w GOTELEMETRY=off
go: unknown go command variable GOTELEMETRY

What did you expect to see?

I'd expect some kind of success message.

As I can see in ~/.config/go/telemetry/ go is already collecting telemetry data, but not uploading it (yet). But I don't trust it and I just want to disable the whole process, because I don't want my compiler to send any telemetry data about my use of it to anyone, however small it might be. From my point of view this is a freaking nightmare!

So, how can I - as of now - shut this down?

seankhliao commented 4 weeks ago

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

TLINDEN commented 4 weeks ago

This was not a question, but indeed a bug. The command go env -w GOTELEMETRY=off does not work. So, either the documentation or the code need to be fixed.

So, please re-open this issue. Thanks.

randall77 commented 4 weeks ago

Read the "[Update ...]" notice at the top of the section where you saw the GOTELEMETRY=off command.

TLINDEN commented 4 weeks ago

Ok, I found how to turn it off: https://go.dev/doc/telemetry#config