Skip to content

Bug: Go 1.23+ ignores custom GOTELEMETRY/GOTELEMETRYDIR settings via env vars or go env config file #72756

Closed as not planned
@ChipZhang

Description

@ChipZhang

Go version

1.23.x, 1.24.x

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/my/go/1.23.7'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/my/go/1.23.7/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.7'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
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 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1972920973=/tmp/go-build -gno-record-gcc-switches'

What did you do?

  1. Set custom GOTELEMETRY and GOTELEMETRYDIR via env vars (for example set it in ~/.profile):
export GOTELEMETRYDIR=/another/path
export GOTELEMETRY=off
  1. check that the system env vars already take effect, env|grep GOTELE prints:
GOTELEMETRYDIR=/another/path
GOTELEMETRY=off
  1. go commands still uses the default settings, for example, go env | grep GOTELE still prints:
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
  1. Set custom GOTELEMETRY and GOTELEMETRYDIR via go env config file than system env vars , still no use.

What did you see happen?

go command forces use default GOTELEMETRYDIR and GOTELEMETRY, and ignores custom settings.

What did you expect to see?

As per the doc,
go command should respect GOTELEMETRYDIR and GOTELEMETRY env var settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions