Commit Graph

989 Commits

Author SHA1 Message Date
Keith Randall a9b653b411 cmd/compilebench: use -a instead of -i to ensure dependencies are built
-i has been deprecated since 1.15, and is now gone in the soon-to-be-1.20.

Change-Id: Ib570f2bcfd0b1feb937990b72e4c9e43e1ada8cd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/443456
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
2022-10-18 15:43:22 +00:00
Tim King ab79327e05 cmd/ssadump: disable run mode with runtime package
Changes `ssadump -run` to ensure that the package runtime
is not imported (changed from must be imported). For several
years, the runtime package has used unsafe constructs
x/tools/go/ssa/interp cannot interpret. This must have been
failing a similar amount of time.

This is unfortunate, but is unlikely to be addressed soon.

For golang/go#43163

Change-Id: I9e2aee640ff7b1123e591e6c49cac9967c5e8da8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/441817
Run-TryBot: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-11 20:40:41 +00:00
cui fliter f90d8ad46c all: fix a few function names on comments
Change-Id: I91eec68ebd9394685a6586c8d0cf01ecf3fd82e2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/441775
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2022-10-10 13:22:38 +00:00
cui fliter 3dda4ba24c all: replace deprecated egrep with grep -E
egrep command is about to be deprecated, use grep -E instead.

Reference: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap04.html

Change-Id: Ib37f5b244ead4c2d46078bea34d4cb6363c48b1b
GitHub-Last-Rev: b1e16d0212d682c780668e62ac8659973bb11a9d
GitHub-Pull-Request: golang/tools#400
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432295
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-09-23 13:31:09 +00:00
cui fliter 5f27e05096 all: remove redundant type conversion
Change-Id: Iffb04ebd6b4afbe1a13b96b7e7469ec3b3e3380f
GitHub-Last-Rev: 6682724eb7cce8e3194650d28cb5eebd78e14700
GitHub-Pull-Request: golang/tools#396
Reviewed-on: https://go-review.googlesource.com/c/tools/+/428980
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-09-07 17:33:19 +00:00
Abirdcfly 4375b29f44 cmd/auth/cookieauth: delete unreachable os.Exit
Change-Id: I5c60eeb8667423544b2bc8b9cf5f51279b0a941d
GitHub-Last-Rev: cb0eca5ff34755a0185729e5c81bf08eb92fab39
GitHub-Pull-Request: golang/tools#388
Reviewed-on: https://go-review.googlesource.com/c/tools/+/418854
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-07-25 18:11:01 +00:00
Ben Sarah Golightly 10494c735e cmd/digraph: fix typo
Change-Id: I086edda41c57b603afa660afb9396e17ba6c1a36
Reviewed-on: https://go-review.googlesource.com/c/tools/+/414074
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-06-25 13:13:44 +00:00
Tormod Erevik Lea a44cc76dc1 cmd/stringer: use explicit NeedX values instead of deprecated LoadSyntax
Change-Id: Ie25f67fd98d34b0a907bd13357e2643b1b79443b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/412914
Reviewed-by: Alex Rakoczy <alex@golang.org>
Auto-Submit: Daniel Martí <mvdan@mvdan.cc>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-06-22 16:23:22 +00:00
Alan Donovan af82757ce0 cmd/callgraph: add test of -algo=vta
This should have been included in
https://go-review.googlesource.com/c/tools/+/410138

Change-Id: Ic8a4f1b5dbcdb320fb872b24484b830dcb56fd41
Reviewed-on: https://go-review.googlesource.com/c/tools/+/410123
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-06-02 22:22:06 +00:00
Alan Donovan b2fbc387b5 cmd/callgraph: add -algo=vta option
This option uses Variable Type Analysis, a refinement of CHA
suitable for partial programs.

Change-Id: I6c8b074e915d29eb9425656f345e8160417ba594
Reviewed-on: https://go-review.googlesource.com/c/tools/+/410138
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
2022-06-02 20:18:38 +00:00
Than McIntosh 1a5eed31fb cmd/compilebench: use -p, handle packages with asm files
Update compiler invocations to pass "-p <importpath>", since that
is the normal way to invoke the compiler these days.  In addition,
add some logic to generate a 'symabis' file for packages that
include assembly source files.

Change-Id: I64c490c55603609cf2cdbfae20ed787a581be4d3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/405734
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-05-11 17:47:50 +00:00
Bryan C. Mills d27d783e99 cmd/godoc: expand skips in TestWeb
After CL 403534, another TestWeb failure was observed in
https://build.golang.org/log/24cca44e99d848317a6bb73b6d15528b500e5643.
This change expands the skips to try to cover more of the cases
where cmd/godoc might hang.

For golang/go#50014.

Change-Id: If3f08da69a68dc00c399b89ffb2c4f049114aeb6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/403849
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-04 21:37:12 +00:00
Bryan C. Mills 04fc2ba822 cmd/godoc: skip TestWeb if waitForServerReady fails
This test fails frequently, with a failure mode that is difficult to
diagnose. (golang/go#50436 may help with that eventually.)

For now, skip the test to reduce noise on the build dashboard.

For golang/go#50014.

Change-Id: I182be5c705846631c983bd5b6c51ab90b71a216a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/403534
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-02 20:36:24 +00:00
Tim King ddadc42f5a guru: Add a TODO list to the guru cmd.
Adds a TODO list for the guru cmd. The main goal is document know
issues that we have not addressed.

Updates golang/go#47326
Updates golang/go#52503

Change-Id: I126b0f06081b606124d89a13f8805fa1ac6e56e3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/403354
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
2022-05-02 17:10:57 +00:00
Russ Cox c862641ee9 cmd/digraph: only print non-trivial sccs
In 'digraph sccs', do not print trivial single-node components.
This is more useful because it distinguishes nodes with self-loops (printed)
from nodes without (not printed).

Also remove an unnecessary TODO about map[string]bool vs map[string]struct{}.
The savings is at most 5% and if we really cared about storage we would probably
not use a map at all.

Change-Id: I6049b3c0f99a913c65f08c6c40e77ae99d1ba8c4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/396834
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2022-04-29 02:53:01 +00:00
Tim King d567bc1c22 go/ssa: monomorphize generic instantiations.
Monomorphize the instantiation of generic functions. Applies type
substitution while building the function instantiation.

Adds a new BuilderMode, ssa.InstantiateGenerics, to enable
monomorphization. InstantiateGenerics is turned on by the flag 'G' in
tools that specify the BuilderMode.

Adds a parameterized field to Program to detect when a MethodValue is
parameterized.

Thunk creation creates new MethodExpr selections. Adds a new methodExpr
type to construct a MethodExpr from outside of types, and selection
interface to generalize a *methodExpr and *types.Selection.

Tests x/tools/go/ssa/interp against the runnable examples in
$GOROOT/test/typeparam/*.go. Some additional models to support files.

Misc. cleanup:
- adding (*canonizer).instantiateMethod to create a canonical
  representative of a method.
- documenting builder.go
- adding (*subster).types that applies type substitution to a list.

Updates golang/go#48525

Change-Id: I885a4223900feaa3664e35caf8618d11ba16a2a7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/356315
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Run-TryBot: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-22 17:17:20 +00:00
Robert Findley 235b13d9b8 cmd/godoc: remove usage of golang.org/x/xerrors
Go 1.12 has not been supported for a while, so it seems safe to replace
usage of xerrors with the native support for wrapped errors in the
standard library introduced in Go 1.13. Remove this usage as a step
toward eliminating the xerrors dependency from x/tools.

If there is any reason to continue to use xerrors, please let me know.

For golang/go#52442

Change-Id: Ic1e5c14f4074b4685a926e884649b9032aaa0f53
Reviewed-on: https://go-review.googlesource.com/c/tools/+/401098
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-20 16:11:05 +00:00
Russ Cox 5fef6fdaed cmd: gofmt
Gofmt to update doc comments to the new formatting.

(There are so many files in x/tools I am breaking up the
gofmt'ing into multiple CLs.)

For golang/go#51082.

Change-Id: I0cc2e6cac2e4ed975770aea78cc2f39c13d6f874
Reviewed-on: https://go-review.googlesource.com/c/tools/+/399357
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-12 17:38:38 +00:00
Bryan C. Mills 48e6d8d2ff cmd/fiximports: skip TestFixImports on plan9-arm
For golang/go#50775.

Change-Id: Ia7d99e9e7b007af3fa35332f0385949867e975eb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/398817
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
2022-04-07 18:45:34 +00:00
Dan Kortschak 4077921f14 all: fix spelling
Change-Id: I13cf73d7e043dda1a06c28bb09e413a76a68df1f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/391934
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
2022-04-04 19:50:34 +00:00
Bryan C. Mills 7d125fe075 cmd/callgraph: expand windows/arm64 skip to the whole platform
This test produces apparent file corruption on all of the
windows/arm64 builders. I suspect that this is a low-level bug (in
either the platform itself or the Go standard library on
windows/arm64).

Since windows/arm64 is not yet a first-class port, this test can be
skipped for now. However, if windows/arm64 becomes a first-class port
the underlying file-corruption bug should be investigated and fixed.

Updates golang/go#50706.

Change-Id: I0bc80cefee50895d40acc658286eb7ef8790493a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/397996
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-04 15:58:39 +00:00
cuishuang 78ff15e680 tools: fix some typos
Change-Id: Iaad847631b9d5ee40558fcf9d51f4dfa99600e6b
GitHub-Last-Rev: 6fcb64f8d9a093e7bd949e5d28bd1176c27005c0
GitHub-Pull-Request: golang/tools#372
Reviewed-on: https://go-review.googlesource.com/c/tools/+/389595
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
2022-03-24 22:24:35 +00:00
Bryan C. Mills e155b03a0e cmd/getgo: exec main from TestMain instead of running 'go build' in tests
This was noticed from
https://build.golang.org/log/da703ece9e1626eaeabf485e1a3a8180a6bde512,
but I suspect not relevant to the getgo test failure observed there.

Updates golang/go#28387

Change-Id: I1a156e780beabb13b4df6fd5313d4785aeb26e97
Reviewed-on: https://go-review.googlesource.com/c/tools/+/390075
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-04 20:37:47 +00:00
Bryan C. Mills 0eabed704f cmd/file2fuzz: exec main from TestMain instead of running 'go build' in tests
This may address a test hang observed in
https://build.golang.org/log/da703ece9e1626eaeabf485e1a3a8180a6bde512.

At the very least, it should make the test much more efficient.

Change-Id: I6a41f9704c8a95276c904f0aee57c4521d642ea7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/390074
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2022-03-04 18:26:08 +00:00
Than McIntosh fb3622a928 signature-generator: add Go func signature fuzzing tools
Add a new subdirectory 'signature-fuzzer' to the x/tools/cmd
directory, with contents:

  internal/fuzz-generator      Guts of the signature fuzzer
  fuzz-driver                  Simple driver for the fuzzer
  fuzz-runner                  Test harness for doing iterative fuzzing

This set of tools is primarily of interest to compiler developers as
opposed to end users. The fuzzer generates random Go code with
"interesting" randomly chosen function signatures (random numbers of
parameters of randomly generated types), then emits code to call these
random functions with known inputs, as well as code that checks to
make sure parameter values were passed correctly and that returns
worked.  The generator tries to include odd scenarios and corner cases
(e.g. reflect calls, recursion, blank params, zero sized types, etc)
so as to explore all the nooks and crannies of the compiler.

This fuzzer was used during the bringup of the new register ABI (as
part of Go 1.17) to identify odd corner cases and flush out bugs. It
may be useful in the future if we have to support new ABI versions or
bring up register ABIs on new architectures.

See the README.md for more details.

Change-Id: Icbc89ddd07c3909a44a005deab43720c7a0dffde
Reviewed-on: https://go-review.googlesource.com/c/tools/+/350329
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-01 16:32:20 +00:00
Michael Matloob 3e31058cd7 internal/imports: update to permit multiple main modules
Now that there there can be multiple main modules due to workspaces in
cmd/go, update internal/imports to no longer assume that there will be
exactly one main module.

Change-Id: I9d044df612fbeaba73b8fc3dbbec0395b54ecba2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/386254
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-22 17:36:43 +00:00
Frediano Ziglio 59f1f2c5a8 cmd/goyacc: reduce array sizes using smaller base types
These arrays can be quite large, reducing the size of them
save lot of space reducing cache usage and file size.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Change-Id: I446088627bc135cb47f6bee919e147b24d1ad848
Reviewed-on: https://go-review.googlesource.com/c/tools/+/374434
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-16 20:47:08 +00:00
Bryan C. Mills 97de9ec466 cmd/fiximports: skip TestDryRun on plan9-arm
For golang/go#50775.

Change-Id: I229263c840f406926b1f7c91de2400d4a18f3e16
Reviewed-on: https://go-review.googlesource.com/c/tools/+/380495
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2022-01-24 16:42:25 +00:00
Bryan C. Mills 2cc1836031 cmd/callgraph: skip TestCallgraph on the windows-arm64-10 builder
We don't know whether this failure is due to a Go bug or a platform
bug, so we'll skip it on the one builder to reduce noise, but not the
GOOS/GOARCH as a whole. If we do not observe failures on other
windows/arm64 builders, we can perhaps chalk it up to a platform bug.
If we do observe failures on other builders, then we'll have more data
to investigate with.

For golang/go#50706

Change-Id: I52511dd4a5cff80953823d9cf901975ff4657457
Reviewed-on: https://go-review.googlesource.com/c/tools/+/379734
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Trust: Daniel Martí <mvdan@mvdan.cc>
2022-01-24 16:42:11 +00:00
Robert Findley 27fc7644e1 all: various test fixes related to any
Fix several tests that were failing at CL 368254 due to inconsistent
formatting of standard library types across Go versions. Generally this
is addressed by replacing interface{} with any, though the mechanism
varies.

Where possible, prefer to update the test data to accurately reflect
1.18 formatting.

Change-Id: Ia92cd565d2ba1dd464891093b78c636fcaff44bc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/370655
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-09 15:47:16 +00:00
Bryan C. Mills 3fca6a08d7 cmd/gorename: log 'go build' output on failure
For golang/go#50043

Change-Id: I90d1e85c59d6f9c9ad30edf0180cb876c2564534
Reviewed-on: https://go-review.googlesource.com/c/tools/+/370254
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-08 16:15:56 +00:00
Dmitri Shuralyov cb80a01bd3 cmd/godoc: remove extra // characters from deprecation notice
The comment is already inside a /* */ block, so no need for //.

Updates golang/go#49212.

Change-Id: I6d50cedab363ed312d85e66797cbc4f652e56dab
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367014
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-11-24 23:04:05 +00:00
Zvonimir Pavlinovic 49ce184b43 cmd/guru: remove use of deprecated ssa.CreateTestMainPackage
For golang/go#48547

Change-Id: I71f061e55d52c45346d34d05ade9c82e9856d6e7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/363655
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-11-12 22:28:40 +00:00
Zvonimir Pavlinovic 2cdcc60405 cmd: avoid printing redundant newlines
For golang/go#49350

Change-Id: Ic566112ff8a8707998b461d2b99fca852f2972f8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/361716
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-11-08 18:39:25 +00:00
Jonathan Amsterdam 513e3fb6ba cmd/godoc: deprecate and point to cmd/pkgsite
Fixes golang/go#49212.

Change-Id: I335749bfecc60f582968af601d9fa030f038e2be
Reviewed-on: https://go-review.googlesource.com/c/tools/+/349051
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-11-01 13:50:47 +00:00
Zvonimir Pavlinovic d6a9af8af0 godoc/analysis: remove deprecated analysis package
Change-Id: I862cae902ea2ff7ed36722d536039cc617200de6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/358954
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2021-10-29 00:04:41 +00:00
Robert Griesemer 9cd58b0b94 x/tools/cmd/stringer: adjust generics tests
Per the issue below, a lone type parameter is not permitted
on the the RHS of a type declaration, at least for Go 1.18.

Slightly modified the generics tests so that they pass for
now.

For golang/go#45639.

Change-Id: I3c5dc0ff65bfdc268c372e5e3fdfe00a8547f17e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/359274
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
2021-10-28 00:09:41 +00:00
Peter Weinberger 88e80df821 cmd/stringer: add a few tests using instantiated generic types
The added tests are in a subdirectory of testdir that is looked
at only if typeparams.Enabled is true, but some test helper routines
needed to be modified to cope with files in a subdirectory.

Change-Id: I82c22a8ba74a1e4a1a2c8669c2271449d5fcaf3a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/355313
Run-TryBot: Peter Weinberger <pjw@google.com>
Trust: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-14 12:38:31 +00:00
Eric Chiang 0b930fbaf4 cmd/goimports: recommend go install instead of go get in docs
go get now logs a warning when using it to install globally. Prefer go
install @latest instead.

Change-Id: I9478771e70c58202847a6dfeaaf63e1b88301d84
Reviewed-on: https://go-review.googlesource.com/c/tools/+/355251
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
2021-10-12 19:23:00 +00:00
Roland Shoemaker 4ad98e9670 file2fuzz: add fuzzer corpus conversion tool
Adds a new tool, file2fuzz, which allows converting existing files into
the corpus format used by the Go fuzzer.

Change-Id: Ic0cd4bc3e8aa6d47489a460ea170a3f38b7b45e9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/336049
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-07-26 20:19:17 +00:00
Diego Medina 126df1d64a cmd/getgo: determine current version via /dl/?mode=json API
The getgo tool was using the golang.org version as the latest
version to fetch. But this is not always the latest version.

We now use https://golang.org/dl/?mode=json which is the
official latest version.

Fixes golang/go#42676

Change-Id: I1cd90bfba12b19759599e89b7b4a095700999c09
Reviewed-on: https://go-review.googlesource.com/c/tools/+/270878
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-07 15:22:48 +00:00
Rob Findley e3dc99f812 cmd/guru: update referrers-json testdata to reflect new line numbering
CL 313251 fixed the describe test, but inadvertently broke the referrers
test due to changing line numbers in describe/main.go. This CL amends
those line numbers.

Fixes golang/go#45778

Change-Id: I1dbdd9157091e061bfa35ec0b5c4690aa09ae092
Reviewed-on: https://go-review.googlesource.com/c/tools/+/313669
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-04-26 20:11:56 +00:00
Rob Findley 3f1e7240c0 cmd/guru: remove test assertions involving unsafe to fix the build
Go 1.17 adds the unsafe.Add and unsafe.Slice functions, which causes the
guru describe assertions about unsafe to either fail at 1.17 or fail at
earlier Go versions.

This is causing the longtest builds to break.

Remove them for now. If we remember, we can add them back once we no
longer support 1.16.

Fixes golang/go#45778

Change-Id: Ie72355fbab8e614c0150097c84c796e78d968839
Reviewed-on: https://go-review.googlesource.com/c/tools/+/313251
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-04-26 17:08:16 +00:00
Dmitri Shuralyov 682c7e60bf godoc/static: link to golang.org for content moved out of Go root
More of the golang.org website content has moved from the Go tree to
the x/website repository in CL 291711, resulting in broken links or
otherwise missing resources in godoc. None of it is affecting godoc's
core functionality, but it's good to fix broken links, so link to the
resources served by golang.org for now.

If it becomes important to make these resources available while godoc
is running offline, that can be done later. (It will be easier once
we can start relying on //go:embed for all supported Go versions.)

Include a local copy of a favicon.ico since the one in Go root is no
longer there as of CL 300549.

For golang/go#32011.

Change-Id: If5bd8e61b72dd9ca1db469d9121e43742846c115
Reviewed-on: https://go-review.googlesource.com/c/tools/+/300394
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-30 17:48:30 +00:00
Dan Kortschak 695b16757a cmd/present2md: allow comments to be retained in translated document
Updates golang/go#41883

Change-Id: I94621f8583ee9fab492f64ae4df442ea856da400
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260898
Run-TryBot: Ian Lance Taylor <iant@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
2021-03-19 17:27:47 +00:00
Josh Bleecher Snyder f5a4005dda cmd/eg: don't do rewrites within the template file itself
Change-Id: I5b408ce894553ea2ffb099f459797edae617ac8a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258305
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2021-02-27 20:30:37 +00:00
Josh Bleecher Snyder 28e7a3b5fe cmd/eg: use go/packages
Rewrite eg to use go/packages, so that it works with Go modules.

There are two known regressions:

* lost build tag support
* you can't use a template to add a new dependency

These can be re-added at a future point as needed.

Change-Id: I2b59bb5e101c738a4d4c40e84a12c5b3a19bcd18
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258304
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2021-02-27 20:30:18 +00:00
Russ Cox 54dc8c5edb playground: remove /share registration, add Proxy
The /share registration is not needed by programs like
talks and blog, only by golang.org, so installing it by default
is unnecessary and perhaps more exposure than people running
those servers intend.

Add Proxy to allow recreating the /share registration (unlikely)
or installing the proxy on an alternate mux (more likely).

Change-Id: Ibb33add804d353920d405bf022428e48b3815da3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/293449
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-25 15:03:53 +00:00
Robert Griesemer 24aca17f68 cmd/guru: adjust describe qualifier function (fix describe test)
The go/types fix for golang/go#44515 changed the type string for unsafe.Pointer
from a fixed "unsafe.Pointer" to a customizable package path followed
by "Pointer" (the customization was in place for any other object already).
The package path customization is done through a user-provider types.Qualifier
function. If none is provided, the ordinary package path is used ("unsafe").

Guru provides a package-relative qualifier which leaves away the package
path if an object is local to a package. As a result, unsafe.Pointer is
printed as "Pointer" which breaks an existing test.

Provide no qualifier function when printing a type from package unsafe
instead (there's only unsafe.Pointer). Since no qualifier was used in
the past, this Guru-specific change will also work when run using earlier
Go versions.

Fixes golang/go#44596.
Updates golang/go#44515.

Change-Id: I3c467e4ed09aa13deb50368fe98e42c723a6376b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/296289
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-02-25 05:05:20 +00:00
Russ Cox 2363391a5b all: go fmt ./...
Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Not strictly necessary but will avoid gofmt changes later
as people edit these files.

Change-Id: I20749ed82e18938a305d9425d0739f0ea7bd24c0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/294414
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-02-20 03:28:52 +00:00