From d40dfd59b8154d022c719406c02d7084c183cb24 Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Tue, 14 May 2024 17:59:50 +0000 Subject: [PATCH] gopls: upload from telemetry.Start, rather than upload.Run Change-Id: I6686ad224870fc3950c37a61cad6edd816e48a00 Reviewed-on: https://go-review.googlesource.com/c/tools/+/585416 LUCI-TryBot-Result: Go LUCI Reviewed-by: Hyang-Ah Hana Kim --- gopls/internal/cmd/serve.go | 4 ---- gopls/main.go | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gopls/internal/cmd/serve.go b/gopls/internal/cmd/serve.go index cc96ca282..16f3b160a 100644 --- a/gopls/internal/cmd/serve.go +++ b/gopls/internal/cmd/serve.go @@ -14,7 +14,6 @@ import ( "os" "time" - "golang.org/x/telemetry/upload" "golang.org/x/tools/gopls/internal/cache" "golang.org/x/tools/gopls/internal/debug" "golang.org/x/tools/gopls/internal/lsprpc" @@ -78,9 +77,6 @@ func (s *Serve) remoteArgs(network, address string) []string { // Run configures a server based on the flags, and then runs it. // It blocks until the server shuts down. func (s *Serve) Run(ctx context.Context, args ...string) error { - // TODO(adonovan): eliminate this once telemetry.Start has this effect. - go upload.Run(upload.RunConfig{}) // start telemetry uploader - if len(args) > 0 { return tool.CommandLineErrorf("server does not take arguments, got %v", args) } diff --git a/gopls/main.go b/gopls/main.go index aeb4ce928..083c4efd8 100644 --- a/gopls/main.go +++ b/gopls/main.go @@ -26,7 +26,11 @@ var version = "" // if set by the linker, overrides the gopls version func main() { versionpkg.VersionOverride = version - telemetry.Start(telemetry.Config{ReportCrashes: true}) + telemetry.Start(telemetry.Config{ + ReportCrashes: true, + Upload: true, + }) + ctx := context.Background() tool.Main(ctx, cmd.New(), os.Args[1:]) }