Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201105173854-bc9fc8d8c4bc / internal / lsp / lsprpc / autostart_default.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/lsprpc/autostart_default.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/lsprpc/autostart_default.go
new file mode 100644 (file)
index 0000000..2ddc5b6
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package lsprpc
+
+import (
+       "os/exec"
+
+       errors "golang.org/x/xerrors"
+)
+
+var (
+       startRemote           = startRemoteDefault
+       autoNetworkAddress    = autoNetworkAddressDefault
+       verifyRemoteOwnership = verifyRemoteOwnershipDefault
+)
+
+func startRemoteDefault(goplsPath string, args ...string) error {
+       cmd := exec.Command(goplsPath, args...)
+       if err := cmd.Start(); err != nil {
+               return errors.Errorf("starting remote gopls: %w", err)
+       }
+       return nil
+}
+
+// autoNetworkAddress returns the default network and address for the
+// automatically-started gopls remote. See autostart_posix.go for more
+// information.
+func autoNetworkAddressDefault(goplsPath, id string) (network string, address string) {
+       if id != "" {
+               panic("identified remotes are not supported on windows")
+       }
+       return "tcp", "localhost:37374"
+}
+
+func verifyRemoteOwnershipDefault(network, address string) (bool, error) {
+       return true, nil
+}