1
0
mirror of https://github.com/golang/go synced 2024-10-01 07:18:32 -06:00
go/internal/lsp/tests
Rob Findley b4fe758a9b internal/lsp/source: don't allow mutating DefaultOptions
DefaultOptions was a value type, but held map values. This CL changes it
to a function that returns an Options value that has new instances of
all reference types. It would be better if this function returned a
pointer, but that change ended up being too large. I will need to
refactor handling of options later anyway, in order to support sessions
with differing options for golang.org/issues/34111.

This fixes a race in internal/lsp/tests: internal/hooks/analysis.go
mutates the Analyzers map.

See for example the trybots result at:
https://storage.googleapis.com/go-build-log/0d34f5f0/linux-amd64-race_4ecdf9c8.log

Change-Id: I41be450b590a3f3104ac9a1cb9cb312ea3ff7ff4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/217077
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-01-31 15:48:08 +00:00
..
completion.go internal/lsp: change CompletionItem.{Command,TextEdit} to pointers 2019-12-16 22:14:42 +00:00
diagnostics.go internal/lsp: don't resend diagnostics if they are unchanged 2019-12-12 04:27:51 +00:00
links.go tools/gopls: add command line support for links 2019-11-01 17:18:15 +00:00
tests_cgo.go internal/lsp/tests: skip cgo tests when not supported 2019-11-25 21:54:41 +00:00
tests.go internal/lsp/source: don't allow mutating DefaultOptions 2020-01-31 15:48:08 +00:00