1
0
mirror of https://github.com/golang/go synced 2024-11-05 15:06:09 -07:00
go/internal/jsonrpc2
Rob Findley 5fb17a1e7b internal/jsonrpc2: support serving over unix domain sockets
For tests (and perhaps later, for daemon discovery), unix domain sockets
offer advantages over TCP: we can know the exact socket address that will be
used when starting a server subprocess. They also offer performance and
security advantages over TCP, and were specifically requested on
golang.org/issues/34111.

This CL adds support for listening on UDS, and uses this to implement an
additional regtest environment mode that starts up an external process.
This mode is disabled by default, but may be enabled by the
-enable_gopls_subprocess_tests.

The regtest TestMain may be hijacked to instead run as gopls, if a
special environment variable is set. This allows the the test runner to
start a separate process by using os.Argv[0]. The -gopls_test_binary
flag may be used to point tests at a separate gopls binary.

Updates golang/go#36879
Updates golang/go#34111

Change-Id: I1cfdf55040e81ffa69a6726878a96529e5522e82
Reviewed-on: https://go-review.googlesource.com/c/tools/+/218839
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-02-19 16:14:01 +00:00
..
servertest internal/jsonrpc2: support serving over unix domain sockets 2020-02-19 16:14:01 +00:00
handler.go internal/lsp: cancel early 2019-10-22 07:49:31 +00:00
jsonrpc2_test.go internal/jsonrpc2: fix invalid invocations of Fatalf in goroutines 2020-02-05 19:51:38 +00:00
jsonrpc2.go internal/jsonrpc2: fix races in cancellation 2020-02-14 14:43:24 +00:00
serve.go internal/jsonrpc2: support serving over unix domain sockets 2020-02-19 16:14:01 +00:00
stream.go internal/jsonrpc2: add telemetry to the rpc system 2019-06-27 03:32:48 +00:00
wire.go all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00