Skip to content

Commit d2879ef

Browse files
committed
cmd/go: document unsettable GOTELEMETRY and GOTELEMETRYDIR go env vars
This change adds documentation to "go help telemetry" and "go help environment" for the unsettable GOTELEMETRY and GOTELEMETRYDIR go env variables. For #68928 Change-Id: I8c139bd8585ffb0c45b9dd722ef6e7a9a33df192 Reviewed-on: https://go-review.googlesource.com/c/go/+/607855 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 422f470 commit d2879ef

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/cmd/go/alldocs.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/help/helpdoc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,11 @@ Additional information available from 'go env' but not read from the environment
678678
If module-aware mode is enabled, but there is no go.mod, GOMOD will be
679679
os.DevNull ("/dev/null" on Unix-like systems, "NUL" on Windows).
680680
If module-aware mode is disabled, GOMOD will be the empty string.
681+
GOTELEMETRY
682+
The current Go telemetry mode ("off", "local", or "on").
683+
See "go help telemetry" for more information.
684+
GOTELEMETRYDIR
685+
The directory Go telemetry data is written is written to.
681686
GOTOOLDIR
682687
The directory where the go tools (compile, cover, doc, etc...) are installed.
683688
GOVERSION

src/cmd/go/internal/telemetrycmd/telemetry.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ To disable telemetry uploading, but keep local data collection, run
4141
To enable both collection and uploading, run “go telemetry on”.
4242
To disable both collection and uploading, run "go telemetry off".
4343
44+
The current telemetry mode is also available as the value of the
45+
non-settable "GOTELEMETRY" go env variable. The directory in the
46+
local file system that telemetry data is written to is available
47+
as the value of the non-settable "GOTELEMETRYDIR" go env variable.
48+
4449
See https://go.dev/doc/telemetry for more information on telemetry.
4550
`,
4651
Run: runTelemetry,

0 commit comments

Comments
 (0)