golang.org/x/tools/gopls@v0.15.3/main.go (about) 1 // Copyright 2019 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Gopls (pronounced “go please”) is an LSP server for Go. 6 // The Language Server Protocol allows any text editor 7 // to be extended with IDE-like features; 8 // see https://langserver.org/ for details. 9 // 10 // See https://github.com/golang/tools/blob/master/gopls/README.md 11 // for the most up-to-date documentation. 12 package main // import "golang.org/x/tools/gopls" 13 14 //go:generate go run doc/generate.go 15 16 import ( 17 "context" 18 "os" 19 20 "golang.org/x/tools/gopls/internal/cmd" 21 "golang.org/x/tools/gopls/internal/hooks" 22 "golang.org/x/tools/gopls/internal/telemetry" 23 versionpkg "golang.org/x/tools/gopls/internal/version" 24 "golang.org/x/tools/internal/tool" 25 ) 26 27 var version = "" // if set by the linker, overrides the gopls version 28 29 func main() { 30 versionpkg.VersionOverride = version 31 32 telemetry.CounterOpen() 33 telemetry.StartCrashMonitor() 34 ctx := context.Background() 35 tool.Main(ctx, cmd.New(hooks.Options), os.Args[1:]) 36 }