Skip to content

Commit 0adbf9c

Browse files
committed
gopls/internal/lsp: simplify the telemetry prompt
Per discussion, update the telemetry prompt to reduce redundancy, and omit the upload date (which is not necessary for the opt-in model). Change-Id: I7e4db24076996f40a39e9653633e3e821a688f3b Reviewed-on: https://go-review.googlesource.com/c/tools/+/532095 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 2ed4298 commit 0adbf9c

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

gopls/internal/lsp/prompt.go

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ Would you like to enable Go telemetry?
198198
if s.Options().LinkifyShowMessage {
199199
prompt = `Go telemetry helps us improve Go by periodically sending anonymous metrics and crash reports to the Go team. Learn more at [telemetry.go.dev/privacy](https://telemetry.go.dev/privacy).
200200
201-
Would you like to enable Go telemetry?
202-
`
201+
Would you like to enable Go telemetry?
202+
`
203203
}
204204
// TODO(rfindley): investigate a "tell me more" action in combination with ShowDocument.
205205
params := &protocol.ShowMessageRequestParams{
@@ -258,24 +258,15 @@ Would you like to enable Go telemetry?
258258
}
259259

260260
func telemetryOnMessage(linkify bool) string {
261-
reportDate := time.Now().AddDate(0, 0, 7).Format("2006-01-02")
262-
format := `Telemetry uploading is now enabled and may be sent to https://telemetry.go.dev starting %s. Uploaded data is used to help improve the Go toolchain and related tools, and it will be published as part of a public dataset.
263-
264-
For more details, see https://telemetry.go.dev/privacy.
265-
This data is collected in accordance with the Google Privacy Policy (https://policies.google.com/privacy).
261+
format := `Thank you. Telemetry uploading is now enabled.
266262
267263
To disable telemetry uploading, run %s.
268264
`
265+
var runCmd = "`go run golang.org/x/telemetry/cmd/gotelemetry@latest off`"
269266
if linkify {
270-
format = `Telemetry uploading is now enabled and may be sent to [telemetry.go.dev](https://telemetry.go.dev) starting %s. Uploaded data is used to help improve the Go toolchain and related tools, and it will be published as part of a public dataset.
271-
272-
For more details, see [telemetry.go.dev/privacy](https://telemetry.go.dev/privacy).
273-
This data is collected in accordance with the [Google Privacy Policy](https://policies.google.com/privacy).
274-
275-
To disable telemetry uploading, run [%s](https://golang.org/x/telemetry/cmd/gotelemetry).
276-
`
267+
runCmd = "[gotelemetry off](https://golang.org/x/telemetry/cmd/gotelemetry)"
277268
}
278-
return fmt.Sprintf(format, reportDate, "`go run golang.org/x/telemetry/cmd/gotelemetry@latest off`")
269+
return fmt.Sprintf(format, runCmd)
279270
}
280271

281272
// acquireLockFile attempts to "acquire a lock" for writing to path.

0 commit comments

Comments
 (0)