This change enables the multi-module workspace mode by default, so that
we can catch all of the test failures and edge cases. It is still
disabled in GOPATH mode and for any workspaces that contain a module
with a vendor directory.
A few minor changes had to be made to handle changes caused by the
workspace module pseudoversions.
Updates golang/go#32394
Change-Id: Ib433b269dfc435d73365677945057c1c2cbb1869
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254317
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
When we're in workspace module mode, there may not be a go.mod at the
root of the workspace, so checking modURI != "" doesn't tell us whether
module mode is on. Add a flag to workspaceMode which is exactly that.
There are probably many more places that should be updated, but since
the design is in flux I don't want to cause more churn than necessary.
This is enough to unblock -mod=readonly by default.
(I missed this in CL 253799 because I was running the wrong Go Version.)
Change-Id: I718ee44c7a2547c90f9d62393aba390c9b4b0f46
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254756
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
We had been previously popping up warning for go.mod files.
Change-Id: I6ff016e94ec46467a5c60309f825798961df66f6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254939
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This change implements the approach described in
https://github.com/golang/go/issues/37629#issuecomment-594179751.
This feature is necessary for multi-module workspace support in gopls.
Updates golang/go#32394
Change-Id: Iab328020a2681f8651405922cc25d9d06cb1ac82
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254368
Trust: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
gopls is officially supported for Go versions 1.14 and 1.15, but we
test with 1.12 and 1.13 as well.
Fixesgolang/go#41383
Change-Id: I89f1a876ccdb25a269a3c39a4d81dd3bf37bd12f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254754
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Previously, we only added roots for contains queries. Now, we borrow
some matching logic from the go command to add roots for any new
packages that originate from overlays, no matter the query pattern.
Ideally, we won't have to borrow this logic once 1.16 is released with
native overlay support.
Change-Id: Iaa06f5ecda47820bd41ed0e42d9c2d33a0539b11
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254418
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
I have no idea what I did to trigger this, but I got a panic in this
codepath. Since this is for completion, it should be OK to simply make
this code defensive, without fully understanding the cause.
Here's the panic:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xc570f3]
goroutine 5914644 [running]:
golang.org/x/tools/internal/lsp/source/completion.(*completer).addFieldItems(0xc0996ee240, 0x1032020, 0xc0dd21e2a0, 0xc0b99b26f0)
/usr/local/google/home/rfindley/src/tools/internal/lsp/source/completion/completion.go:1065 +0x193
Change-Id: I82350b30172ead95b6611962c2e040cc49259dc2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254697
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
As we have modified the ways that we control which analyzers get
executed for a given case, we have lost the behavior of enabling and
disabling staticcheck smoothly. This CL splits out the staticcheck
analyzers from the main group so that the "staticcheck" setting can
override whether or not a given staticcheck analysis is enabled.
Fixesgolang/go#41311
Change-Id: I9c1695afe4a8f89cd0ee50a79e83b2f42a2c20cb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254038
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Go 1.16 may set -mod=readonly by default. To maintain current behavior,
gopls needs to override that by passing -mod=mod to all its go
invocations.
While this behavior should be safe on all modern versions of Go, I gated
it on 1.16 just for safety's sake.
Change-Id: Ic8088213d1ab9ab3a3ed0b51f47b2c222974d613
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253799
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
These are the changes needed to support Semantic Tokens in the LSP protocol.
Added a function to server.go to make generating server_gen.go work again.
Change-Id: I2e09220560b080dd666e25eaf1a39b9960b6f871
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253938
Run-TryBot: Peter Weinberger <pjw@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change adds an experimental configuration, which when enabled,
shifts gopls to operate in multi-module mode. It implements the
super-module as described in
https://github.com/golang/proposal/blob/master/design/37720-gopls-workspaces.md.
Replace directives are also added when a workspace module requires
another workspace module (which has not yet been mentioned in the design
doc).
A user-provided workspace gopls.mod file is not yet supported, as it is
not yet testable. Clients will need to add support for change
notifications for the gopls.mod once it is added.
Updates golang/go#32394
Change-Id: I5089358603bca34c5c8db9e5a00f93e1cca0b93f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/247819
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
The logic to de-dupe workspace symbols was broken in two ways:
- The 'seen' map of files already processed was never written.
- The key to 'seen' was *ast.File, which doesn't work if we parse
twice.
Fix this by de-duping instead on span.URI.
Change-Id: Iedadfac17a0a993570ff4f8301a97815477f1c2c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/254117
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Build tags are a common stumbling block for users of gopls, as build
tagged files may be excluded from the initial workspace load without a
clear warning. This change adds a check for every opened file to confirm
if it maps to a package. If not, we show a message with suggestions.
A follow-up improvement might be to check if the opened file actually
has build tags to make the error message more precise (and give a better
example config).
Updates golang/go#31668
Change-Id: I829d8546edea65aa08274021bfde8ea2fb6eeaa1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253798
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
I missed that this test was failing when fixing the 1.12 build, because
I forgot that I moved the regtests to the gopls module. Hoisted by my
own petard.
Change-Id: I1cf601e730fa7bb92885f55b68845b539e57e1a0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253937
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Gopls needs to use the right go command to work properly on a source
distribution. One way of getting this done is by setting go.alternateTools.
Fixesgolang/go#38603
Change-Id: Ie379b372c48f651a22c73d93f8608194c5e3a417
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253297
Run-TryBot: Peter Weinberger <pjw@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Something about the ordering of `go list` results must have changed in
Go 1.15, so overlays with test variants were failing to get the correct
imports. Technically, the correct solution would have been to support
overlays for a package *and* its test variant, but for the purposes of
gopls, it's actually more important that the overlays apply to the
package itself (rather than its test variant).
Fixesgolang/go#40685
Change-Id: I3282557502f7f30bf484e1e6c17b90db824bc7d0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252681
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
gopls has many settings. We want to automatically generate
documentation, and we want to allow clients to perform their own
validation if they so desire.
Using all three of AST, type information, and reflection, generate a
JSON description of the settings and their default values. Add a gopls
command that prints it. Add a documentation generator that uses it to
write settings.md.
I assumed that everything not explicitly documented was experimental,
and moved it into that section. I also moved expandWorkspaceToModule to
experimental; I hope it's not long for this world, personally.
Along the way, rename many fields, make the enum matching case
insensitive, and add a stringer call so that the defaults print nicely.
Fixesgolang/go#33544.
Change-Id: Ibb652002933e355ed3c6038d6ca48345b39b3025
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252322
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change adds one more test for package completions (and slightly
modifies the way we pass in file content without a terminal newline).
Also, a few tiny modifications to the package completion code.
Change-Id: I3041b5ad648873881b2b8df17df6f78fbd1898e5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253177
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Danish Dua <danishdua@google.com>
Broke a.go into a few files (no real logic to it). These tests could be
categorized better, but it's a good start just to break up that huge
golden file.
Change-Id: I2c173f11ea2766e9232e3ec838c16f535cbee788
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253279
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
I think we had discussed making this change after you finished your
cache rewrites, but I never got back to it. Let me know if you think
there's a better way to do this.
Change-Id: Ia7dfe6830110f21e0d2683e64f8ee0d2549afdea
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253280
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This CL creates a struct that simplifies some of the extract function
logic. Also, add a test for extraction with an underscore in the
selection (Josh mentioned that this might not work, but it seems too).
Change-Id: If917614a5824e84fb79a07def3eb75f48f10a5b9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253277
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Completion is slowly becoming a large part of internal/lsp/source and it
makes sense to move to its own seperate package inside source to make
future refactors easier. As a part of this change, any unexported
members from source required by completion are now exported. Util
functions only required by completion are moved from
internal/lsp/source/util.go to internal/lsp/source/completion/util.go.
Change-Id: I6b7405ec598c910545e649bb0e6aa02ffa653b38
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253178
Run-TryBot: Danish Dua <danishdua@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
It's useful to be able to switch between case sensitive, case
insensitive, and fuzzy matching for symbol without having to reload
gopls. FZF has some nice syntax for this:
https://github.com/junegunn/fzf#search-syntax
Adopt a subset of this syntax for our symbol search:
' for exact matching
^ for prefix matching
$ for suffix matching
It would be straightforward to also support inversion, using
'!', but I deemed this unnecessary.
I think we should adopt this, since none of these symbols conflicts with
Go identifiers, or (AFAIK) with special syntax in major LSP clients.
Change-Id: If2e4d372d4a45ace5ab5d4e76c460f1dcca0bc2b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/248418
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Update the title of the diagnostic to account for the fact that
fillreturns can also use in-scope variables to fill in values.
Change-Id: Ib506af76a4187ef611e96b2602f301432fcbccf0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253278
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
A recent change (silently) broke our go1.12 presubmit, because we don't
yet have a means to surface this breakage. Coming soon: a 'gopls CI'
custom Gerrit label.
In the meantime, fix the build.
Change-Id: I31f5b7512403fdbd8869652cd4b8e77b084c8534
Reviewed-on: https://go-review.googlesource.com/c/tools/+/253517
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
The type checker sometimes emits secondary diagnostics. For instance,
if a function is defined twice, then when it sees the second definition
it emits a diagnostic at the second definition and a secondary diagnostic
pointing to the first diagnostic. Presently gopls treats these as two
separate diagnostics. The changed code still produces two diagnostics,
but now the secondary diagnostic is also converted into a
RelatedInformation so the user sees a xpointer to the earlier definition.
Updates https://github.com/golang/go/issues/39062.
Change-Id: Ic421ec91d2b46c28681ab3ec010d5b02c0442e68
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251617
Run-TryBot: Peter Weinberger <pjw@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change adds support for package completion in all files at valid
positions. By parsing expressions from an invalid file, we can check if
the cursor is at a position where package completion would be a valid
suggestion. These are positions above any other statements or
declaration or at prefix of the keyword pacakge above these
statements/declarations. This also introduces imporved end of file
handling in completion.
Change-Id: I2a865d018f58c3a98b69fb4100d186b507d123bd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251618
Run-TryBot: Danish Dua <danishdua@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
To match the actual gopls binary, use hooks.Options when creating the
regtest server.
Add a test for staticcheck diagnostics to leverage this.
For golang/go#39384
Change-Id: I52837c2b12bb586a2530343bdfae5172b08df49c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252683
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Regtests are slow, and make `go test ./internal/lsp/...` slow. Also,
having them in the tools module means they can't use staticcheck,
go-diff, etc.
Move them to the gopls module. This means that they're annoying to work
with unless you open the gopls module, but hopefully that annoyance will
be gone soon when we support multi-module workspaces.
For golang/go#39384
Change-Id: Ib99c994ffdac56d4da13af981ad397a90a7523af
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252682
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Pressing enter on editable go present code adds a new 'pre' html tag
which isn't being handled properly. This fix in play.js adds a newline
to the html is being parsed whenever it sees a 'pre' tag.
Fixesgolang/go#41139
Change-Id: I042d13999f4a8518fb282c4c5bfb3a5197215449
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251697
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
The cleaning process happens in the end method of process, after cmd.Wait.
Deleting it early while the cmd is still running is causing issues for
security tools.
Move the assignment of p.path along with its comment to happen earlier,
after the temporary directory is created. It clarifies that the lack of
call to os.RemoveAll is not a mistake.
Fixesgolang/go#40902
Change-Id: I0e555c58893c64a0de5880a5e12e6ff2e01b1eec
Reviewed-on: https://go-review.googlesource.com/c/tools/+/249777
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Fix the comment end position for multi-line comments to account for the
closing "*/".
Fixesgolang/go#41057
Change-Id: I5dd3886a81d274514e78f47ac2e7194fd9cceb06
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252457
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Refactor the checks for code lenses being enabled out of the source
package so that the mod code lenses can also make use of them.
Also, a few small changes to the titles of the `go mod tidy` and `go mod
vendor` code lenses.
Change-Id: I4e79ab08a4e7aea4d4d6de6fd652d0b77d30c811
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252397
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
A new method was added to testing.testDeps in CL 250977, which causes
the implementation of that (unexported, explicitly-unstable) interface
in go/ssa to no longer satisfy the interface.
This is a quick, short-term fix. Longer term, the go/ssa package
should switch to the supported TestMain API.
Updates golang/go#41186
Change-Id: Ice110ef540e31a0a98085713346126ffeae64d5e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252677
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This adds tests for golang/go#40690, as well as a case for a bug in
changing package names.
Updates golang/go#40690
Change-Id: I516404e77728024f8bee3da31a88bad1f1917a9b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251017
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This changes add package completions suggestions for new files. Package
suggestions are other packages used in the same directory, test
packages for those packages, the package 'main' and the directory name.
Fixesgolang/go#34008
Change-Id: I69922e0cb0787e82eebe505618c3c07aa48859e6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251160
Run-TryBot: Danish Dua <danishdua@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
In cases where the remote panics, make it clearer in the forwarder logs
that the remote has disconnected.
Change-Id: Ic7f9370f615198274696a18adaefe7dc62cac02e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/250508
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This is better than parsing the default output.
Also, change the start progress message, since it ends up duplicating
the title in the message that the user sees.
Change-Id: I3540d30c7976c6be0722531b2e258341081e0b72
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251920
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit includes the four "With" functions from the context package in the
list of unused functions. This will produce the following error:
./main.go:9:19: result of context.WithValue call not used
When analyzing this:
```go
func f(ctx context.Context) {
context.WithValue(ctx, "foo", -6)
}
```
Fixesgolang/go#41149
Change-Id: I5456b79396d45d15498070b5184d5de8c257b343
GitHub-Last-Rev: 577c6b380690477280ed6e941f9dee2057af90f3
GitHub-Pull-Request: golang/tools#248
Reviewed-on: https://go-review.googlesource.com/c/tools/+/252057
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Also, add a directory parameter to RunGoCommand. To make sure that the
parameters aren't misused, change args to a []string.
Updates golang/go#40340
Change-Id: Ib5ce606a401a18c29c904b570ec9339f067a3961
Reviewed-on: https://go-review.googlesource.com/c/tools/+/245818
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>