When substituting an argument that has been synthetically packed into a
composite literal expression, into the varadic argument of a call, we
can undo the variadic elimination and unpack the arguments into the
call.
Fixesgolang/go#63717Fixesgolang/go#69441
Change-Id: I8a48664b2e6486ca492e03e233b8600473e9d1a9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/629136
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Rewrite our call site processing of imports, to simplify, and so that we
can re-use the import lookup logic in the assignStmts strategy for the
purpose of writing out types.
A large TODO is included for a hypothetical refactoring of the inlining
logic that could formalize these types of interactions between call site
analysis and inlining strategy.
Fixesgolang/go#65217
Change-Id: Ifd99ea14430deba3a03cdfb936b6edee9e81d0bf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/629435
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Refactors the ZeroExpr and ZeroString functions to provide more
consistent and correct handling of zero values for input types.
- Refactor: Unify similar switch case statements in both functions with
exception of types.Tuple. ZeroExpr panic due to the lack of a valid
ast.Expr representation.
- Fixing an issue where ZeroExpr returned nil for types.Array instead of
a composite literal.
- Adding support for type parameters in ZeroExpr, similar to ZeroString.
- Consolidating tests for both functions into TestZeroValue.
Change-Id: Ic77ae17ea091cf51bd4d4642186fe13093e0d461
Reviewed-on: https://go-review.googlesource.com/c/tools/+/627604
Reviewed-by: Tim King <taking@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This CL provides an implementation of the Source interface to
use an index to the go module cache to satisfy imports.
There is also a test.
Change-Id: Ic931cb132fcf7253add7fc7faadd89726ee65567
Reviewed-on: https://go-review.googlesource.com/c/tools/+/627235
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
When inlining, a removed argument does not contain the last use of a
name if that name is also used by another arg that is referenced by the
callee. Implementing this logic improved a test case for
golang/go#65217.
For golang/go#65217
Change-Id: I486306f4ed57d759d5ab65bb390db5e81332d3ef
Reviewed-on: https://go-review.googlesource.com/c/tools/+/629295
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Derived from https://go.dev/cl/603935.
Change-Id: I409347a5bdf2218450d06f688b4c13fd302b2a16
Reviewed-on: https://go-review.googlesource.com/c/tools/+/619416
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tim King <taking@google.com>
This commit switches the test to use crypto/rc4 instead of crypto/ecdsa.
The crypto.ecdsa package will soon be imported into the FIPS module,
producing an unexpected import of crypto/internal/fips/ecdsa by the
pre-existing test.
Instead, use the rc4 stdlib package. This won't be under consideration
for FIPS.
Change-Id: I87bcaa04efe1138aa80bf7ce88f0df74469daf4d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/629115
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
- Unnamed/blank parameters are now assigned zero values, as
they are not referenced within the function body.
- The `zeroString` function has been moved from `go/ssa` to
`internal/typesinternal` for better organization.
- Honor the input parameter name from the function signature.
- Input parameters from both consutrctor and target functions
are flattened into the test case struct. Potential field
name duplication is handled by introducing prefixes.
For golang/vscode-go#1594
Change-Id: I8b56d8f3e0f0432d4f9fe269cc7ba86ea46decfc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/626537
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
With multiple return statements, a slice append would overwrite the
return values of earlier returns. Fix by using slices.Concat.
For golang/go#66289
Change-Id: Ib23bcb9ff297aa1ce9511c7ae54e692b14facca7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/627537
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Write an index even if there is nothing in the module cache.
Change-Id: Ia98f8825d9914a0d4bd2ee9ff1bccf8519b91f37
Reviewed-on: https://go-review.googlesource.com/c/tools/+/626735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Add a new Dir field, and export ForTest, per golang/go#38445. The
needInternalForTest mode bit is promoted to NeedForTest, but no mode bit
is added for Dir as it is logically related to NeedFiles.
A test is added for the new fields using a simpler txtar-based setup,
since I did not have time to page in the quite heavyweight packagestest
framework.
For golang/go#38445
Change-Id: I92026462f7ed7e237db1f4e50a3bbf2936802fbb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/626495
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Avoid assigning end positions to type errors that are within the current
token (such as could happen in an import path). To test this, introduce
our first named argument in the marker tests: 'exact' for the @diag
marker.
Also, attempt to document the heuristic of TypeErrorEndPos.
Fixesgolang/go#69505
Change-Id: If3cf82f241dd354d834a7dcbf24b7b3c59246911
Reviewed-on: https://go-review.googlesource.com/c/tools/+/625916
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
+ test
Change-Id: I6c44e32d34bcdf1ca68e8989e99595f691c88329
Reviewed-on: https://go-review.googlesource.com/c/tools/+/626016
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Also, update all imports outside of that package.
Updates golang/go#70229
Change-Id: I8b08f892ec86d560c0406319c2954eb9912d78ad
Reviewed-on: https://go-review.googlesource.com/c/tools/+/625920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
The only remaining uses of go/expect are from packagestest.
Updates golang/go#70229
Change-Id: I5a8c835b761381747fbd3f936d261ed773b536e3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/625919
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Almost no-one outside x/tools uses it, so we'd like to evolve
it for our needs, and tag and delete the public package.
Updates golang/go#70229
Change-Id: I77c7923881efdf772a1ad53134483ad0078c941d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/625918
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
In preparation for integrating the newly implemented shared module cache
index, carve out a minimal imports.Source interface to be used by
FixImports. For now, this interface has a single implementation,
wrapping the legacy ProcessEnv abstraction, but in the future we can
replace it with an implementation that synthesizes the module cache
index with gopls' own view of the workspace.
This CL intentionally avoids any refactoring aside from extracting the
ProcessEnv-specific logic into a ProcessEnvSource.
For golang/go#36077
Change-Id: I189a908c917aba68868b08845880b1f0aa731180
Reviewed-on: https://go-review.googlesource.com/c/tools/+/623296
Reviewed-by: Peter Weinberger <pjw@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Findley <rfindley@google.com>
As described in golang/go#69630, our 1.21 and 1.22 builders were not
actually testing gopls' integration with the Go command, because go test
modifies PATH and GOROOT when performing a toolchain switch.
"Fix" this by searching PATH for a local (=non-toolchain) go command,
and then mutating PATH and unsetting GOROOT to use this go command. This
is very much a hack, as noted in the relevant commentary, but allows us
to have much needed test coverage on the builders. In golang/go#69321,
we hope to design a better solution to this problem.
Many tests are updated to make their go version requirements accurate.
Fixesgolang/go#69630
Change-Id: I431107b97845e1e99799c2c22f33b04f85ce6dd9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/623175
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Findley <rfindley@google.com>
This CL fixes a bug (#70149) in gopls/internal/golang/pkgdoc.go
in which a call to fset.File(file.Pos()) would return nil
because when file points to an empty ast.File, Pos() returns NoPos.
Instead, we should use file.FileStart, which is (in principle)
always valid even for an empty file. However, there is a separate
bug in go1.23 (#70162) that means FileStart is invalid whenever
Pos() is. So, this fix only works with go1.24, and there's no
real workaround short of the additional logic this CL adds to
parsego.Parse, which at least covers all of gopls.
Also, we audit all of x/tools for similar faulty uses of Pos()
and replace them with FileStart. In future, we should use File.Pos
only for its specific meaning related to the package decl.
Fixesgolang/go#70149
Updates golang/go#70162
Change-Id: Ic8cedfe912e44a0b4eb6e5e6874a6266d4be9076
Reviewed-on: https://go-review.googlesource.com/c/tools/+/624437
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The os package will return ModTime values in the local time zone.
We have to parse the time stamp in the local time zone so that
comparisons are done correctly.
Fixesgolang/go#69893Fixesgolang/go#69894
Change-Id: I93631cdc64dda8fdfcdf668e10e0ec939ef1461d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/624615
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
Delete or selectively skip tests that made either of the following
assumptions:
- The default GODEBUG is that of Go 1.22 (not true given a go.work
file).
- GOROOT is a development version of Go (not true if GOROOT is prepared
by cmd/distpack).
Fixesgolang/go#70081Fixesgolang/go#70082
Change-Id: I47dfb225427f75e3be833eed3ba677ff454935f1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/622896
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Consolidate the logic of type checking and analysis, for the following
benefits:
- Simplify by eliminating redundant logic to type check and import
packages in the analysis driver.
- Reduce work by reusing type checked packages in analysis. By the time
we run analysis on open packages, we likely have type checked the
packages already, so the work to type check inside the analysis driver
is very much redundant.
- Reduce work by reusing the package key from packageHandle (which we
have gone to great pains to optimize).
- Reduce work (and file cache space) by avoiding the need to store
export data alongside analysis facts.
- Leverage the precision of our reachability analysis by using a bloom
filter of reachable packages to better filter facts.
- This indirectly fixesgolang/go#64227 and golang/go#64236, since the
crashing logic is deleted.
For golang/go#53275Fixesgolang/go#64227Fixesgolang/go#64236
Change-Id: I431b8da35b2dce7c63f56ec1a3727e0747b79740
Reviewed-on: https://go-review.googlesource.com/c/tools/+/622038
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(*Index).Lookup returns matching symbols from the index.
Change-Id: I7b805be9a08116e111bb8d6453ed67f8cc92dd4d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/621035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Although the workaround in CL 621855 was effective for gopls,
which uses go1.23, the x/tools builders using go1.22 are
still bumping into this data race.
This change applies the same workaround to go1.22;
the data type has not changed.
Fixesgolang/go#69912Fixedgolang/go#70015
Change-Id: I9f12f8815a0b089a188b9d02aec9d07eb30a496a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/622319
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Create() creates a new index, while Update() may write an
updated index, if there have been any changes in the module cache
since the last index was written. If there is no index it creates
one. It returns true if it wrote a new index, false if there was
no need to write a new index.
Change-Id: Ic797796c2ab6db6bd93b2059df86249ae62ca8ec
Reviewed-on: https://go-review.googlesource.com/c/tools/+/621860
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Work around golang/go#69912 by punching a hole through the TypeName type
to mark it black after importing. This is an unfortunate workaround, but
the fix for the long-standing data race is probably not worth
back-porting.
For golang/go#69912
Change-Id: I583305f6e893e28b881dab932c9c4825430bc4ad
Reviewed-on: https://go-review.googlesource.com/c/tools/+/621855
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
As described in golang/go#69937, we need a mechanism that allows for
concurrent request handling in gopls. However, this cannot be
implemented entirely within the jsonrpc2 layer, because we need gopls to
observe requests in the order they arrive, so it can handle them with
the correct logical state.
This CL adds such a concurrency mechanism using a trick similar to
t.Parallel. Specifically, a new jsonrpc2.Async method is introduced
which, when invoked on the request context, signals the
jsonrpc2.AsyncHandler to start handling the next request.
Initially, we use this new mechanism within gopls to allow certain
long-running commands to execute asynchronously, once they have acquired
a cache.Snapshot representing the current logical state. This solves a
long-standing awkwardness in the govulncheck integration, which required
an additional gopls.fetch_vulncheck_result command to fetch an
asynchronous result.
This enables some code deletion and simplification, though we could
simplify further. Notably, change the code_action subcommand to
eliminate the progress handler registration, since we don't need
progress to know when a command is complete. Instead, use -v as a signal
to log progress reports to stderr.
Fixesgolang/go#69937
Change-Id: I8736a445084cfa093f37c479d419294d5a1acbce
Reviewed-on: https://go-review.googlesource.com/c/tools/+/621055
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This CL eliminates the "goroot" flavor of
TestIExportDataTypeParameterizedAliases, leaving just
the "tools" flavor, and simplifies accordingly.
The logic of the goroot version assumed that importer.Default()
could read what gcexportdata.Write would write... except that
that comments correctly stated the assumption was false.
Updates golang/go#68898
Change-Id: Ifded4ed2cc2103de32ac869731176a49877d10e0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/620036
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Symbol types should be a single character, and now they are.
func F(int, float) is legal. Before it was being treated as if it were
F(), now it is treated as if it were F(_ int, _ float), which seems
better.
Change-Id: I051f60b16edccf54c4ce30f11b33a458413fa9af
Reviewed-on: https://go-review.googlesource.com/c/tools/+/620138
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Presently the command will create or update the index of the module
cache, or clean out obsolete indexes. An index is obsolete if it is
both more that an hour old, and not a current index pointed to by some
index-name file.
Change-Id: Ie3a79587e0e230ae7ab0b7d854c97003ace783ff
Reviewed-on: https://go-review.googlesource.com/c/tools/+/616838
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This CL is the result of a quick audit
of x/tools for places that look in the Types map and do
not handle missing entries gracefully (unless dominated
by a check for welltypedness, such as RunDespiteErrors:false
in the analysis framework). In each case it either adds
a defensive check or documents the assumption.
See https://github.com/golang/go/issues/69092#issuecomment-2389643780
Updates golang/go#69092
Change-Id: I3573512fd47ee4dca2e0b4bce2803b92424d7037
Reviewed-on: https://go-review.googlesource.com/c/tools/+/617416
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
This CL contains tests that the module cache
index can be updated. The tests cover all the
cases in modindex.go.
Change-Id: Ia5988fb0d2be1cbe5e26d9d5d0f0d43ce1e0e5d2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/619695
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Derived from https://go.dev/cl/603935.
Change-Id: I1c5ab7cc180c33e69244fe2cfdc79fd9625eab95
Reviewed-on: https://go-review.googlesource.com/c/tools/+/619235
Commit-Queue: Tim King <taking@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This reverts commit f8f3c13ff3.
Reason for revert: https://go.dev/cl/619395 appears to be a better solution for the same problem.
Change-Id: Ie3f290fca74b2cc2627484504b6db780f89b3bb4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/619415
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tim King <taking@google.com>
A NamedOrAlias represents either a *types.Named or a *types.Alias.
Used this generalization in gopls.
This change is derived from https://go.dev/cl/603935.
Change-Id: Ica1669784dec6bcdefafde02e9a6ce789db28814
Reviewed-on: https://go-review.googlesource.com/c/tools/+/618735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Commit-Queue: Tim King <taking@google.com>
This CL adds information about exported symbols to the module cache
index, together with a minimal test.
A future CL will add a Lookup function for finding completions for
selectors.
Change-Id: Ic36b5f30383187f9c5551ee2757258ed1445ea53
Reviewed-on: https://go-review.googlesource.com/c/tools/+/616416
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
InitFileVersions is not longer conditionally needed at x/tools
supports Go >= 1.22.
Change-Id: I5df1b46463d23acda569e1378027d542ac749f93
Reviewed-on: https://go-review.googlesource.com/c/tools/+/617637
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Commit-Queue: Tim King <taking@google.com>
Updates test expecations now that go.dev/cl/607955 has been submitted.
Change-Id: I795a14f7690026620f270e2db329945286764046
Reviewed-on: https://go-review.googlesource.com/c/tools/+/617635
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tim King <taking@google.com>
Conditionally enable the gotypesalias GODEBUG setting based on the
gotoolchain used to compile the tool.
Change-Id: I1e698249f943c8f2cb95c3acbc45aedf64260667
Reviewed-on: https://go-review.googlesource.com/c/tools/+/617636
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tim King <taking@google.com>
Use (types.Object).String() to write expectations now that the
formatting for type parameterized aliases was fixed.
This resolves a TODO in TestIExportDataTypeParameterizedAliases.
Change-Id: I5b5d55cb7c190686c89dec59bdad30d83de595a5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/616995
Auto-Submit: Tim King <taking@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Cleaning up the documentation for skipping tests in 1.22 when gotypesalias=1.
Change-Id: Iaf387ff83d2d771d3a0196d6ca26aa49516799dd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/615699
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Tim King <taking@google.com>
Run larger and standard library tests both with and without the
gotypesaliases GODEBUG enabled. Skips two know failures on 1.22.
Fixes an incorrectly copied constant in an expectation.
Change-Id: I8054bf5609b7a0e6fb544bd906a00f2f02f75b31
Reviewed-on: https://go-review.googlesource.com/c/tools/+/616157
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Commit-Queue: Tim King <taking@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Use types.NewInterfaceType directly. This has been available since Go 1.11.
Change-Id: I3669ce485bc99a758530158db02a470d81ad7b85
Reviewed-on: https://go-review.googlesource.com/c/tools/+/615697
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Commit-Queue: Tim King <taking@google.com>
Vary the types in predeclared() based on the runtime value of any
in types.Universe (either universeAnyNoAlias or universeAnyAlias).
Change-Id: Iacf43d21c7d078706ac20ded7ffdeadffbb4baf5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/615683
Commit-Queue: Tim King <taking@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
goexperiment.unified was removed in 1.21.
Change-Id: I388d657da578f33616c45b8a18a2266443956757
Reviewed-on: https://go-review.googlesource.com/c/tools/+/615995
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Tim King <taking@google.com>
* Fix default value test ("") for TestNewAlias.
* Updates references to 1.19 to 1.22.
Change-Id: I9c19621e820c90c265235afff863863d03f2d171
Reviewed-on: https://go-review.googlesource.com/c/tools/+/615696
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
The existing BenchmarkInitialWorkspaceLoad does not open files, which
means it measures only the speed of loading and verifying the workspace
state, with hot caches. It does not measure the memory or time consumed
when starting to actually work on a file.
Fix this by opening a file.
Also, add -profile.block to gopls and -gopls_blockprofile to gopls
benchmarks, for better diagnosis of contention.
Change-Id: I63ef7c9a26ca71ddd9b6895369921655eaa4f090
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614163
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
This CL contains the first part of a package for maintaining an
on-disk index of the module cache. The index is stored as text.
Eventually it will consist of a header, followed by groups of lines,
one for each import path, and sorted by package name. The groups of lines
start with a header containing the package name, import path, name of the
directory, and semantic version,
followed (but not in this first CL) by lines, each of which contains
information about one exported symbol.
This CL only contains the code for computing and updating the information
about directories and import paths, and reading the index. It does not
compute anything about exported symbols, which will be in the next CL,
and hence it does not present an API for looking up information about
completion of selectors.
There is a test that among directories with the same import path it can
find the one with the largest semantic version.
Change-Id: I0883ea732cf34f6700f5495e6dfd594e8f286af9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/612355
TryBot-Bypass: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
And where not, document why.
(Locations were found by instrumenting parser.ParseFile
and running gopls' tests.)
Change-Id: Iab205b1f96b4fb4b22a5d056b40fbbb326dcd7a4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/615436
Auto-Submit: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>