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>
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>
Set gotypesalias=1 when using >=1.23 toolchain on all of
the main packages in x/tools that use go/types. Does not include
packages that are ignored due to build tags.
This effectively upgrades commit https://go.dev/cl/617095.
For golang/go#69772
Change-Id: I434c280b928ad21e1fd9c7f880e1324c14741dc3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/619395
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>
Fix a broken test build on android due to inconsistent build constraints
in test files.
Change-Id: I6350797fb65f2f2699e11b95b01a4aa3b3b84307
Reviewed-on: https://go-review.googlesource.com/c/tools/+/618996
Run-TryBot: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Set GODEBUG variable gotypesalias to off in all main packages
in x/tools that use go/types.
This is a no-op as the x/tools go.mod is uses version 1.22,
which disables gotypesalias in main packages and tests by default.
Change-Id: I1593cd63ec018e230e126d990530bd59fb9a96cf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/617095
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tim King <taking@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Adds additional passes over the test variants of the given
package. Picks the most "narrow" (least amount of files)
package where each type can be found. The generated code
will be placed in the same package and test-or-not-test file
as the original type declaration.
Closesgolang/go#66557.
Change-Id: I2354cd44e357a9ce0b45f5e2fadc1c141455a88d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/604535
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Previously, the -tags flag used the obsolete buildutil.TagsFlag,
which only affects the behavior of the obsolete go/loader.
This change causes the -tags flag to affect go/packages
in these three tools, as it should.
Updates golang/go#69556
Updates golang/go#69538
Change-Id: Ie45c51c7fe04863dba00bc2f81b0a78f1c9bd0e3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614895
TryBot-Bypass: Alan Donovan <adonovan@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
This CL does not include simplifications to gopls.
Updates golang/go#65917
Updates golang/go#69095
Change-Id: I2b54992681e2c671324e22668d8401962a1d2363
Reviewed-on: https://go-review.googlesource.com/c/tools/+/593683
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
These two declarations can now safely be accessed directly
from go/types.
Also, remove all mention of internal/aliases from gopls/...
We can enable two suppressed tests now that go1.23 is assured.
Updates golang/go#46477
Change-Id: I9ae8536b0d022e3300b285547c18202bed302cf2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614638
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tim King <taking@google.com>
Reviewed-by: Tim King <taking@google.com>
This makes it so that 'go install golang.org/x/tools/cmd/gorename@latest'
will continue to work. ('go install pkg@version' does not allow
replace directives.)
Updates golang/go#69360
Change-Id: I46a16a5d8dc7d1d1cf6c428388484e27f266f4e2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614635
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gorename is deprecated.
(Use gopls's Rename RPC or rename command instead.)
Once this module is tagged, we will delete it.
Clients will be able to use only the last version.
Updates golang/go#69360
Change-Id: I89ea5feade02f9fb15c7244847810f3c2261f7ff
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614158
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
That version is faster and uses less memory.
Change-Id: I1839aa672fab25833da2ffa2dfcb079db67dd922
Reviewed-on: https://go-review.googlesource.com/c/tools/+/610537
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Calls such as fmt.Printf(s), where s is non-constant and there
are no arguments to format, are invariably a mistake. This
CL causes the printf checker to report them, and to offer
a suggested fix of fmt.Printf("%s", s).
Also:
- tests
- docs
- fixes to existing violations in x/tools (3 bugs, 2 merely bad form).
- an ignore-tagged main file for the printf checker.
Fixesgolang/go#60529
Change-Id: Ic7cc4f3e7487bc1549948fa03b5b0b27959948e5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/585795
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Tim King <taking@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Add -count flag to be able to say 'run 100 and stop'.
This is useful when using stress to test for flakes in
a git bisect loop or other scripts.
Print the number of active commands during status
updates. This is useful for knowing what's going on
as the run reaches its conclusion (and earlier).
Sort flag list.
Change-Id: Iad4ef3069aeebbb58923ea3696909d2c1e9dbd91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/576916
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Thanks to @ct16k for reporting the crash and suggesting the fix.
Also, a test.
Fixesgolang/go#67915
Change-Id: I72472603e52831d5e571cb8a4e053fd15ff49b72
Reviewed-on: https://go-review.googlesource.com/c/tools/+/591615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
The errors guarded against in the `if` conditions are not the errors
printed with`log.Fatalf()` — instead, they are the same errors copied
from the immediately-preceding error checks.
Maybe some sort of copy-paste mistake.
Reasoning:
- The error printed is always `nil` at the changed lines (`err1`).
- The error printed should be a non-`nil` error (`err2`).
Change-Id: I5e4c1e6a460fb37d9d8652b727e641db2245e3c5
GitHub-Last-Rev: 77a4e86342
GitHub-Pull-Request: golang/tools#489
Reviewed-on: https://go-review.googlesource.com/c/tools/+/580235
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
RIP guru, Go's LSP server before LSP was invented.
Fixesgolang/go#65880
Change-Id: I75adef368e6e940c3b6dfc0ca06ad38ba0cf3656
Reviewed-on: https://go-review.googlesource.com/c/tools/+/569882
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>
This is the first step of deleting guru.
Updates golang/go#65880
Change-Id: Id33729265825f5557a47a5c571b2ae0e2d58336a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/570136
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This change adds a helper function to the template environment
to make it easier to compute the token.Position of an ssa Function.
Also, improve the documentation.
Fixesgolang/go#65980
Change-Id: I16d4cc87bb6f96985684da5ce027be296f22a601
Reviewed-on: https://go-review.googlesource.com/c/tools/+/567838
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This change is the result of an audit of all type assertions
and type switches whose operand is a types.Type. (These were
enumerated with an analyzer tool.)
If the operand is already the result of a call to Underlying
or Unalias, there is nothing to do, but in other cases,
explicit Unalias operations were added in order to preserve
the existing behavior when go/types starts creating explicit
Alias types.
This change does not address any desired behavior changes
required for the ideal handling of aliases; they will wait
for a followup. In a number of places I have added comments
matching "TODO.*alias".
It may be prudent to split this change by top-level directory,
both for ease of review, and of later bisection if needed.
During the audit, there appeared to be a recurring need
for the following operators:
- (*types.Func).Signature (golang/go#65772);
- Deref(Type): it's easy to forget to strip off the
Alias constructor;
- ReceiverName (CL 565075), for destructuring receiver
types such as T and *T, in which up to two Aliases
might be present.
Updates golang/go#65294
Change-Id: I5180b9bae1c9191807026b8e0dc6f15ed4953b9a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/565035
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>
Change-Id: I78701b620029a94b47524f5d4a77c35a86df2e4e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/564337
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This change causes deadcode to enumerate the "universe set"
of functions based on the source-level declarations, not
the ssautil.AllFunctions helper. The former set is accurate
(and also much cheaper to compute), whereas the latter is
a mess (as its doc comment attests).
In particular, it omits unexported methods of uninstantiated
types, which are of course unreachable. This makes for
some sense for whole-program analysis, but none at all
for a dead code tool that specifically wants to know
the useless functions.
The new logic is pleasantly simpler.
Also, a test.
Fixesgolang/go#65915
Change-Id: I7a4a64fd3da18d089044530911cdb2e3b42d0db5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/567156
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
...and factor numerous places to use it.
(This pattern kept recurring during my types.Alias audit,
golang/go#65294.)
Change-Id: I93228b735f7a8ff70df5c998017437d43742d9f3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/565075
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: 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>
The last version v0.1.0-deprecated was published.
Fixesgolang/go#60951
Change-Id: Ib178384ba3a4010edd509825f8a9106853ccf703
Reviewed-on: https://go-review.googlesource.com/c/tools/+/564657
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
Using go env CGO_ENABLED has an advantage over build.Default.CgoEnabled
in that it pays attention to whether a C compiler is available in $PATH,
so it correctly skips the test when cgo is not enabled in more contexts.
I haven't found better docs for this than https://go.dev/doc/go1.20#cgo.
Also add this in TestCgoCwdIssue46877, since it requires cgo.
Change-Id: Ib14a983cc179b725a98f154846662887a91edc19
Reviewed-on: https://go-review.googlesource.com/c/tools/+/560175
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
This reverts commit 7d125fe075.
Windows/arm64 builders have been migrated to Azure
using Windows ARM64 hosts instead of qemu + Mac. Let's see if the
issue still reproduces.
Change-Id: I2c55812c9eb9710ac2849e65987f55baf7766b13
Reviewed-on: https://go-review.googlesource.com/c/tools/+/559115
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
The lsp directory is no more.
Change-Id: I7badd01645c7faab841e6219387cb84d8b893f2b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/557741
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>
Without this change, the created trace files cannot be read by "go tool trace":
2023/12/25 09:51:02 Parsing trace...
failed to parse trace: no EvFrequency event
Change-Id: I59964875c8e821262db2cc6bbc82b2be385e1618
Reviewed-on: https://go-review.googlesource.com/c/tools/+/553555
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Windows sometimes does support symlinks, so we shouldn't over-skip on
that platform. On the other hand, wasip1 sometimes does not support
symlinks, so we should allow Symlink to fail on that platform.
Instead of hard-coding which platforms *don't* support symlinks,
let's hard-code the ones that always do, and skip on error otherwise.
That way, these tests will be robust to new platforms going forward,
and will default to running the tests if Symlink actually works.
Fixesgolang/go#64702.
Fixesgolang/go#64701.
Change-Id: I1cd5034effa4d8d66fd2cd3092926c0a2e3e76d8
Cq-Include-Trybots: luci.golang.try:x_tools-gotip-wasip1-wasm_wasmtime,x_tools-gotip-wasip1-wasm_wazero,x_tools-gotip-windows-amd64-longtest,x_tools-gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/tools/+/549555
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The "golang.org/x/sys/execabs" package was introduced to address a
security issue on Windows, and changing the default behavior of os/exec
was considered a breaking change. go1.19 applied the behavior that was
previously implemented in the execabs package through CL 403274.
This reverts fe37c9e135 (CL 284773).
Updates #43724.
Change-Id: I53987d0d0009b8dd11e05fc3d17cbffb9625a9c1
GitHub-Last-Rev: 18e93f39c4
GitHub-Pull-Request: golang/tools#455
Reviewed-on: https://go-review.googlesource.com/c/tools/+/539017
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Commit-Queue: Bryan Mills <bcmills@google.com>
The +build to go:build syntax conversion has progressed enough that
it's fine to write only the new syntax now. All supported (and many
unsupported) Go releases understand it.
For golang/go#41184.
For golang/go#60268.
Change-Id: I8c1600577a21f4c7c89123302ca976d881a69841
Reviewed-on: https://go-review.googlesource.com/c/tools/+/536075
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Change-Id: Ic0b04040ab869c69898a0b7b7b17d1fe624aa4cc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/536135
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Some linker flag, e.g. -linkmode=external, can change the go
command's behavior, e.g. which packages to include. Pass the
linker flags to prebuild, as well as "go list" for constructing
the importcfg file. This ensures that in -linkmode=external mode
runtime/cgo is built and included, avoiding a linker warning.
Fixesgolang/go#63383.
Change-Id: I185e8dd2e6de7601a343739186117bce3c19e492
Reviewed-on: https://go-review.googlesource.com/c/tools/+/533855
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
The test can't run on platforms where exec is not implemented.
Make similar skip messages a bit more detailed and consistent.
For golang/go#61104.
Change-Id: I40cecd428cf0a7b6195aee146df6ed92deea0950
Cq-Include-Trybots: luci.golang.try:x_tools-gotip-js-wasm
Reviewed-on: https://go-review.googlesource.com/c/tools/+/533158
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Rather than just omitting the -compiling-runtime flag (which is needed
for tip of master as of CL 521697), do a test run of the assembler to
see whether the flag is accepted. If it is, then assume we need it
when running the assembler for package 'reflect', so as to ensure
compilebench keeps working properly for old Go versions.
Change-Id: I17fb54c37a94aef08e0b855579d1d1c333880092
Reviewed-on: https://go-review.googlesource.com/c/tools/+/529560
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
When building assembly for the "reflect" package, we should no longer
be passing the "-compiling-runtime" flag (it is no longer supported,
since the toolchain now infers the runtime property based on the
import path).
Change-Id: I364959b86038816f34811ab450edc1bc5c0382d0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/529300
Auto-Submit: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Although ioutil.ReadDir is deprecated, the suggested replacement has
a different signature, returning []fs.DirEntry rather than []fs.FileEntry.
Some of the places where this occurs are better left referring to ioutil,
as build.Config wants the old behavior. (go/buildutil/util.go and
godoc/vfs/os.go) When someday build gets updated, these can be easily
found, and changed.
Some of the place use Mode().IsRegular() (cmd/toolstash/mail.go and
internal/fastwalk/fastwal_portable.go) and the code needs a minor adjustment.
And, happily, in all the other places one can use os.ReadDir directly
as only Name() is called.
There are no remaining instances of the generated ioutilReadDir().
Change-Id: I165ca27eafe2fe37fdf14390543b21f7e198281e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/528135
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Peter Weinberger <pjw@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
ioutil defines 7 functions. 6 of these are replaced by
functions in io or os with the same signature.
ReadDir is deprecated, but the suggested replacement has a different
signature.
These changes were generated by a program, with some manual adjutments.
The program replaces ReadDir with a call to a function named ioutilReadDir
that has the same signature. The code for this function
is added to files if necessary. The program replaces all the others
with their new versions. The program removes the 'io/ioutil' import
and adds, as necessary, 'os', 'io', and 'io/fs', the latter being
needed for the signature of ioutilReadDir.
The automatic process fails in a few ways:
1. ReadFile occurs only in a comment but the program adds an unneeded import.
2. ioutilReadDir is added to more than one file in the same package
Both of these could be viewed as bugs and fixed by looking harder.
After manual adjustment, two tests failed:
1. gopls/internal/lsp/regtesg/mis:TestGenerateProgress. The reason
was a use of ioutil in a txtar constant. The calls were changed,
but the code is not smart enough to change the import inside the
string constant. (Or it's not smart enough not to change the
contents of a string.)
2. gopls/internal/lsp/analysis/deprecated, which wants to see a use
of ioutil
These tests were adjused by hand, and all tests (-short) pass.
Change-Id: If9efe40bbb0edda36173d9a88afaf71245db8e79
Reviewed-on: https://go-review.googlesource.com/c/tools/+/527675
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Peter Weinberger <pjw@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
In order to replace gopls legacy builds on Kokoro with LUCI, it is
easiest to get x/tools tests passing at older Go versions.
This CL gets tests passing at 1.18 and 1.19, using various techniques:
- Where it was easy to carve out some leave node of the package graph,
just use go:build directives.
- Add an internal/compat package with compatibility shims (much like
the typeparams package, which is coincidentally now obsolete). It
turns out, the only required shim is Appendf.
Notably, some go/ssa and go/ssa/interp tests recurse infinitely due to
a go/types bug, which was not investigated.
Change-Id: Ib2e6cc8a804ead394a324a4598728b200b24091c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/526264
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Also associate the stderr and stdout output of subprocesses more
clearly with the specific test.
For golang/go#62534.
Change-Id: I6768f2d8d60e21d4d6465208c17b542691a3f803
Reviewed-on: https://go-review.googlesource.com/c/tools/+/526172
Commit-Queue: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
This is an experimental command that perhaps would become "go new"
once we have more experience with it. We want to enable people to
experiment with it and write their own templates and see how it works,
and for that we need to put it in a place where it's reasonable to ask
users to fetch it from. That place is golang.org/x/tools/cmd/gonew.
There is an earlier copy in rsc.io/tmp/gonew, but that isn't the right
place for end users to be fetching something to try.
Once the tool is checked in I intend to start a GitHub discussion
asking for feedback and suggestions about what is missing.
I hope we will be able to identify core functionality that handles a
large fraction of use cases.
I've been using the earlier version myself for a while, and I've found
it very convenient even in other contexts, like I want the code for a
given module and don't want to go look up its Git repo and so on:
go new rsc.io/quote@v1.5.2
cd quote
Change-Id: Ifc27cbd5d87ded89bc707b087b3f08fa70b1ef07
Reviewed-on: https://go-review.googlesource.com/c/tools/+/513737
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>