go/internal
Bryan C. Mills b7d757405f internal/lsp/protocol: avoid replying with non-nil interface values in case of error
The JSON-RPC 2.0 protocol requires that responses objects
have either a "result" or an "error", but not both.
In Go, this corresponds to a non-nil result interface value or a
non-nil error.

However, the generated wrappers for the LSP protocol were passing
non-nil values for both in case of error, due to passing typed-nil
pointers as (non-nil) interfaces (see
https://go.dev/doc/faq#nil_error).

This change fixes the generator to explicitly pass only one or the
other, and re-runs the generator at the existing commit.

For golang/go#49387
For golang/go#46520

Change-Id: I582b52820bdac15d9f947e8d6c1e9daa70c53e40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/388600
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-13 01:06:48 +00:00
..
analysisinternal go/analysis/passes/tests: Check malformed fuzz target. 2022-02-16 18:26:19 +00:00
apidiff all: gofmt 2022-04-12 17:53:17 +00:00
event all: gofmt 2022-04-12 17:53:17 +00:00
fakenet
fastwalk all: gofmt 2022-04-12 17:53:17 +00:00
gocommand internal/imports: update to permit multiple main modules 2022-02-22 17:36:43 +00:00
gopathwalk internal/gopathwalk: remove unnecessary call to os.Lstat 2022-03-31 05:33:07 +00:00
imports all: gofmt 2022-04-12 17:53:17 +00:00
jsonrpc2 all: fix spelling 2022-04-04 19:50:34 +00:00
jsonrpc2_v2 all: fix spelling 2022-04-04 19:50:34 +00:00
lsp internal/lsp/protocol: avoid replying with non-nil interface values in case of error 2022-04-13 01:06:48 +00:00
memoize all: gofmt 2022-04-12 17:53:17 +00:00
packagesinternal internal/lsp/cache: disable network for mod tidy diagnostics 2021-02-05 19:41:14 +00:00
proxydir
span internal/span: fix a comment about windows drive letters 2021-08-03 19:59:22 +00:00
stack all: gofmt 2022-04-12 17:53:17 +00:00
testenv all: gofmt 2022-04-12 17:53:17 +00:00
tool gopls: cleanup the main help pages 2022-02-02 14:57:28 +00:00
typeparams all: gofmt 2022-04-12 17:53:17 +00:00
typesinternal internal/typesinternal: update typesinternal for 1.18 2022-02-22 16:42:18 +00:00
xcontext