1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:18:32 -06:00
Commit Graph

910 Commits

Author SHA1 Message Date
Jeremy Faller
a1f8cf0047 cmd/benchcmp: add deprecation notice
Change-Id: Ifa408a53f6a1edba3b8e53aae2048d999a5da45c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/216843
Reviewed-by: Austin Clements <austin@google.com>
2020-02-10 18:42:41 +00:00
Rebecca Stambler
207d3de1fa all: fix some staticcheck errors
Updates golang/go#35718

Change-Id: I10bfd5421cd44bb58b8bcaa6e9205040c25f51be
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208257
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-01-29 04:53:41 +00:00
Daniel Martí
bf1340f18c cmd/stress: use an ellipsis when truncating output
While investigating golang/go#36664, the entire output of a failure
could get pretty long - past fifty lines of content. I was getting
confused as to why the output was being cut off.

I had to discard a number of theories (the test being buggy, my expected
output being wrong, etc) before I realised that something was truncating
the output for the sake of the reader.

Since that's what stress is doing, make it add an ellipsis character
too, to further hint to the user that the output is being truncated for
readability. Separate it with a newline to make it easier to notice.

Change-Id: Ie052c13bb48d6fd842d6054848161266d9ea17e6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/215597
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-01-22 22:00:14 +00:00
Adam Williams
9dc88fb721 cmd/stringer: remove redundant check in generated code
In a certain case, stringer would generate the following check for an
an unsigned integer i: "0 <= i". This changes stringer to not generate
such a check.

Also adds an additional test case for an unsigned multiple run that does
not include zero. There was already a case ("unum") that included an
unsigned multiple run starting at zero. This case's output was updated
accordingly.

Fixes golang/go#36461

Change-Id: I57e79384a0b802fa4571e2b3495db168b814bcaa
Reviewed-on: https://go-review.googlesource.com/c/tools/+/214180
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2020-01-14 01:55:19 +00:00
Rebecca Stambler
8647d4c879 cmd/gopls: delete legacy gopls
gopls should always be built in module mode from the gopls module. I
don't think that anyone is relying on this anymore, and we should stop
allowing users to build gopls from within the tools module.

Change-Id: I7dea4339d4c8ffc4ca168e679b810be743e5f92c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/212520
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2019-12-27 05:11:00 +00:00
Jay Conrod
210e553fe1 cmd/fiximports: fix 'go list' error formatting
Error positions should be printed, when specified.

Also, made main_test less picky about whitespace before and after
error output.

After this change, the test for cmd/fiximports should pass before and
after CL 210938.

Updates golang/go#36087

Change-Id: I681d1ee07f7f19a0d9716b88678e2737f4c691de
Reviewed-on: https://go-review.googlesource.com/c/tools/+/211337
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2019-12-17 20:38:50 +00:00
Heschi Kreinick
621d4eef75 imports: pass more of the environment
goimports now wants various module flags, but I forgot to set them up in
the many places we create environments. Do so.

Change-Id: Ic3817caeb8fc4d564b49006ef6ca6842b2498eaf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/211581
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-12-17 00:36:01 +00:00
Rebecca Stambler
b832835c53 cmd/gopls/integration: remove old VS Code extension for debugging
I have moved this extension out of this repository and into
https://github.com/stamblerre/gopls-debug. It is now published in the VS
Code marketplace. We weren't really doing anything with this, so there's
no need to keep it in this repo. Future integration-related code should
live in golang.org/x/tools/gopls/integration.

Change-Id: Id01e1d55d141a7305fa688a72f8c9ccbee0e28c1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208997
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-11-26 19:44:37 +00:00
Dmitri Shuralyov
f51c1a7cd2 cmd/godoc: delete unused autocert hooks
The autocert.go file in x/tools was deleted in CL 162400, but some
related variables were left behind. This change deletes them, since
they are unused by now. (If you're feeling déjà vu, it's likely
because this was done in x/website in CL 197957.)

Updates golang/go#29206
Updates golang/go#32011

Change-Id: I070f711e8bbc7b54f1d169571356fdc24bc00137
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208259
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-11-21 21:43:50 +00:00
Dmitri Shuralyov
91381dc0ae cmd/godoc: don't execute go list -m all when GOMOD is /dev/null
When the GOMOD value is the operating system's null device, there
isn't a main module. Return an empty build list right away, since
running 'go list -m all' in Go 1.14 will cause a "cannot match "all":
working directory is not part of a module" error.

Fixes golang/go#35690
Updates golang/go#35728

Change-Id: I024ca3b7d774835140ce4a1625133aff6554a533
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208258
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-11-21 20:13:55 +00:00
Dmitri Shuralyov
688c506a55 cmd/godoc, godoc/static: remove remnants of golang.org website
The canonical home for the golang.org website by now is
the golang.org/x/website/cmd/golangorg command. That is
the command that should be used to run the website locally
instead of godoc.

This change reduces the scope of x/tools/cmd/godoc to be
a minimal Go Documentation Server. It removes the remaining
pieces of the golang.org website and changes the title from
"The Go Programming Language" to "Go Documentation Server".

The web tree is modified as follows:

• The index page has been modified to redirect to /pkg/,
  which serves a list of packages.
• The /doc/ tree is removed.
• The /robots.txt and /opensearch.xml pages are removed, since
  the primary use case for godoc now is a local web server.
• The Google Analytics sections are removed from static templates,
  since it's always an empty value in local web server mode.

Fixes golang/go#32011
Updates golang/go#29206

Change-Id: Id62c5f335fa2059774893ef4dcd268649278e99d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/207777
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-11-20 19:55:55 +00:00
Jean de Klerk
b3340bdf36 cmd/digraph: omit unnecessary empty lines in focus
There's currently a bug which will print additional lines, since append adds to
the end of an array instead of starting from the first open position. That cause
strings.Join to print empty lines for each of the pre-allocated array elements.
So, this CL changes the make to set capacity instead of len, and sets len to 0.

Change-Id: Iaf6d07ca2648d0bbcafcd21a5b485cccd7f0c68c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208137
Run-TryBot: Jean de Klerk <deklerk@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-11-20 15:59:38 +00:00
Jean de Klerk
e97fc27222 cmd/digraph: add focus
Focus prints the subgraph of all paths through the focused label.

Change-Id: I20fa9fb079f733addcd3cec85aa608f4979fdb24
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184357
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-11-20 14:37:58 +00:00
Dmitri Shuralyov
1c71899d35 cmd/godoc: don't execute go mod download when GOMOD is /dev/null
When the GOMOD value is the operating system's null device, there
isn't a main module and thus there cannot be module requirements.
Don't try to fill module cache, since running 'go mod download'
would cause a "no modules specified (see 'go help mod download')"
error to be printed, which is confusing.

Fixes golang/go#35476

Change-Id: Ia1f5ee50797a4dc3e36c3b9773e19da781bd9d39
Reviewed-on: https://go-review.googlesource.com/c/tools/+/206886
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-11-15 17:30:08 +00:00
Arda Güçlü
bd32a3e739 cmd/benchcmp: add unit test for formatNs function
Test function is added for formatNs function in the benchcmp package.

Change-Id: I9a1050be9fba3b5e217741d3faadbf5d913d1d4d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/206857
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-11-14 16:00:03 +00:00
Arda Güçlü
9d59ce8a7f cmd/go-contrib-init: add unit test for the cmdErr function
Change-Id: I5f03eb6ea220befb15e5318634124d1b5005e0b1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/205799
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-11-11 20:03:10 +00:00
Dmitri Shuralyov
3113a4aab4 cmd/godoc: add initial support for module mode
This change implements initial support for viewing Go package
documentation with godoc in module mode. There are no UI changes.

When running the godoc binary in a directory where module mode
is active (i.e., go env GOMOD reports a non-empty path), the
documentation will be shown for packages provided by modules
rather than from the GOPATH workspace.

The mode can be controlled in the same way as the go command, by
changing the GO111MODULE environment variable¹ value. For example,
'GO111MODULE=on godoc' will force godoc to run in module mode, and
'GO111MODULE=off godoc' will force godoc to run in GOPATH mode.

It is implemented by reusing the existing virtual filesystem
abstraction. The main module and all of its dependencies (in
other words, the build list²) are determined by invoking the
go list -m all command in the same directory. An attempt is
made to fill the module cache with any selected module versions
that are not already in the local module cache.

This behavior can be controlled in the same way as the go command,
by setting the GOPROXY environment variable. For example, setting
GOPROXY=off disables downloading of any modules. If any of the
modules could not be fetched, it is printed to stderr and
documentation is shown for all other available packages.

¹ https://golang.org/cmd/go/#hdr-Module_support
² https://golang.org/cmd/go/#hdr-The_main_module_and_the_build_list

Fixes golang/go#33655

Change-Id: I86f795537b65acae3771afd19d2e7cb360425467
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196983
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-11-07 17:57:43 +00:00
Emmanuel T Odeke
423eeaeda5 cmd/bundle: add -tags flag
Adds a "-tags" flag that'll allow build tags
to be passed in and added to the very top of the
generated and bundled file.

For example, when generating h2_bundle.go for
net/http, we'll now be able to do:

    bundle -tags '!nethttpomithttp2' -o h2_bundle.go
                -prefix http2 golang.org/x/net/http2

Updates golang/go#35082

Change-Id: I55edd7227aec8641b60ba560c79e0d50d0692d52
Reviewed-on: https://go-review.googlesource.com/c/tools/+/205017
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-11-04 19:56:21 +00:00
Filippo Valsorda
b9c20aec41 cmd/stringer: fix package godoc
CL 191309 broke it by adding a newline before the package clause.

Change-Id: Ic039649734ae086a891227b5926e028fe7e62325
Reviewed-on: https://go-review.googlesource.com/c/tools/+/204137
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-29 19:07:41 +00:00
Jean de Klerk
9525425c6f cmd/digraph: use node instead of label ubiquitously
Currently, vertices are referred to as nodes in (most) user-facing
documentation, and labels in the code itself (and some user-facing
documentation). This CL changes all references to vertices to use the word node.

Change-Id: I0a409c08122f198b11ff891cbea24b41aba89e40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200938
Reviewed-by: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
2019-10-24 13:39:24 +00:00
Daved
18e3458ac9 cmd/present: fix origin mismatch for websocket when using HTTPS
Fixes golang/go#31328

Change-Id: Ib190f42970d5b203e3f1fbf997aa896cf624bf91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/171118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-14 20:52:21 +00:00
Ian Cottrell
5889748991 internal/lsp: use options hooks to install diff driver
Change-Id: I2f94c2a68d0036a47ccac3fce07cf9f3b784d443
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200558
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-11 16:38:31 +00:00
Agniva De Sarker
79dbfd6c86 cmd/godoc: update findGOROOT
After godoc stopped being part of the Go distribution, the location
of the godoc binary and the go binary can be different. Hence the old
GOROOT finding logic does not work anymore.

We shell out to "go env GOROOT" to return the new GOROOT.

Fixes golang/go#23445

Change-Id: I16e4c0798e3f5cda13d9f6546cf82808a10c4a0b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/199279
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-07 18:40:23 +00:00
Dmitri Shuralyov
90aeebe843 cmd/godoc: move poll sleep to top of loop
CL 196979 moved the pollInterval sleep to the bottom of the loop
with the intent of not sleeping before the first readiness check,
but that caused an unintended consequence of the sleep being skipped
when errors happen. Move it back to the top to avoid that problem.

Change-Id: Ia63f09afe47d93df657ca867ceecc4d7df6abccc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197940
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-30 15:27:28 +00:00
Dmitri Shuralyov
7da961ddcf cmd/godoc: convert tests to packagestest, cover third party packages
This change converts cmd/godoc tests to use the packagestest package
in its basic integration tests. For now, those tests continue to run
in GOPATH mode only. When module support is added to cmd/godoc, then
the same tests will be made to run in module mode too.

Previously, the basic integration test covered godoc functionality
on Go packages in GOROOT only. This change also adds some third
party packages to increase test coverage. This is easy to do with
the packagestest API.

Updates golang/go#33655

Change-Id: If3fce913140b81ed9340556d6bb4b963f5f98813
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196981
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-09-29 03:02:02 +00:00
Dmitri Shuralyov
d04c33d1d0 cmd/godoc: check if server exited when waiting
Previously, the waitForServer family of helpers would wait anywhere
between 15 seconds to 2 minutes for the server to become ready.
But if there's a problem that results in the server exiting early,
that wasn't being detected quickly.

This change modifies tests to also wait for command to exit,
and fail the test quickly if so. This helps during development.

Updates golang/go#33655

Change-Id: I16195715449015d7250a2d0de5e55ab9a1ef078d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196979
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-09-29 02:38:57 +00:00
Ainar Garipov
feee8acb39 all: fix more typos
Change-Id: I978ad5e1800ebfceb78aaced438331a8341715d4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/194697
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-11 15:13:14 +00:00
Jeremy Faller
663385e6ef cmd/compilebench: add more linker benchmarking
Change-Id: I84ac9637b9d4221f38acbd2bfe8e1d1fc3097f48
Reviewed-on: https://go-review.googlesource.com/c/tools/+/194680
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2019-09-11 14:31:56 +00:00
Bryan C. Mills
df13fa7beb all: do not write to testdata directories
I got tired of spurious 'git' diffs while a 'go test' was running, so
I fixed the test that produced the diffs. (We need to do that anyway
in order to run them in the module cache, plus it's just good hygiene
not to have tests interfering with each other's sources.)

Tested using:

	$ chmod -R ugo-w . && go test ./...; chmod -R u+w .

Updates golang/go#28387

Change-Id: Ie17e31aecf0e3cb022df5503d7c443000366a5c6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/192577
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-08-30 17:05:20 +00:00
Bryan C. Mills
c17b040389 all: skip tests if required tools are not found
Fixes golang/go#33950

Change-Id: Iefcb757e773bc052793611c099c25a457fd7e243
Reviewed-on: https://go-review.googlesource.com/c/tools/+/192400
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-08-30 15:40:57 +00:00
Tobias Klauser
95c3470cfb all: replace reference to plan9.bell-labs.com with 9p.io
Change-Id: I5fbe6f0f4a3bf99841fcbb4b47101ff5556db50d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/191297
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-08-26 06:06:29 +00:00
Anderson Queiroz
aa644d2adf x/tools/cmd/stringer: document -linecomment in the GoDoc
Fixes golang/go#29867
Change-Id: I0328a97c9e2ee4b42a0b0d2b9948bf69a6ee3322
Reviewed-on: https://go-review.googlesource.com/c/tools/+/191309
Reviewed-by: Rob Pike <r@golang.org>
2019-08-23 09:35:17 +00:00
Andrew Bonventre
b1e2c8edce cmd/getgo/server: update to go112 GAE runtime
Change-Id: Ib8a301da7ce32ece3fe15d7cbecddeaf380ec43a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/191377
Reviewed-by: Katie Hockman <katie@golang.org>
2019-08-22 19:19:35 +00:00
Jean de Klerk
6d4652c779 digraph: add transpose
Change-Id: Idd6299fd7397840000139ce4fbea43a95ee76b1e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/186797
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-09 14:56:39 +00:00
Jean de Klerk
a4e10e6d0e digraph: refactor somepath to print an adjacency list
Refactors somepath to print an adjacency list from "from" to "to", instead of
just the nodes. This allows other tools like modgraphviz to print the subgraph.

This is a breaking change. The previous behavior returned vertices; now it
returns edges. If you relied on the previous behavior, use:

    my-application | digraph somepath <from> <to> | digraph nodes

Change-Id: Id5e77e19eea79849ec6f25018f627c8dc4e2a831
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184338
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-08-09 14:56:25 +00:00
Ian Cottrell
625c92e46d internal/lsp: have tests report a different application name to the main gopls binary
Change-Id: I246dc9c468ee35586a8332ebdf41f23521adbc6c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/186677
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-07-18 23:01:26 +00:00
Jean de Klerk
fefcef05ab digraph: refactor allpaths to print an adjacency list
Refactors allpaths to print an adjacency list from "from" to "to", instead of
just the nodes. This allows other tools like modgraphviz to print the subgraph.
For example, the following command:

    cd $GOPATH/src/cloud.google.com/go && \
    go mod graph | \
    digraph allpaths cloud.google.com/go golang.org/x/text@v0.3.2 | \
    modgraphviz | \
    dot -Tpng -o graph.png

Generates the following graph.png: https://user-images.githubusercontent.com/3584893/60481727-df0a8680-9c4b-11e9-8df9-c581d599edd1.png

Also splits out the allpaths tests into their own test, and adds many test
cases.

This is a breaking change. The previous behavior returned vertices; now it
returns edges. If you relied on the previous behavior, use:

    my-application | digraph allpaths <from> <to> | digraph nodes

Change-Id: I2eb7c377f5fe1e1e90c5b74eaa78d5211192bb2a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184337
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-07-16 02:13:16 +00:00
Jean de Klerk
2868181328 digraph: clean up docs, usage, copyright
- Move verbose usage docs to godoc, replace usage with terse description of
usage and commands.
- Add copyrights.
- Update usage to more canonical function format instead of const format.

Change-Id: I30d072f391bbf9911798e90efb85cd5351d99205
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184177
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-07-10 18:46:09 +00:00
Johan Brandhorst
44aeb8b7c3 cmd/present: correct function reference.
A previous change introduced a new way of storing
which page should be synced with the notes, but
used the wrong function name. This corrects the
function reference.

Fixes golang/go#32902

Change-Id: Iefbb189eae12f0d53e46e6f42d3526302515cab3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184737
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-07-02 20:17:34 +00:00
Daniela Petruzalek
a101b041de cmd/present: use unique key for destSlide in local store
We use a 'destSlide' entry in the local storage to keep presentation
and notes in sync while using '-notes' flag. This caused a name
collision if we had different presentations open at the same time.

This changes the 'destSlide' key in local storage to
'destSlide:<presentation-url>' to avoid collisions between different
presentations.

Fixes golang/go#24688

Change-Id: I4833fa83856a96b5978c09ed7e4360484ba4f109
Reviewed-on: https://go-review.googlesource.com/c/tools/+/178659
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-06-24 22:21:33 +00:00
Ian Cottrell
10539ce303 cmd/gopls: preparing for v0.1.0
Change-Id: I6b749858cbba0ec300caa77426ba0ae69a97677d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/181997
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-06-12 23:17:17 +00:00
Brad Fitzpatrick
7be61e1b0e cmd/splitdwarf: fix skip on Windows
Unify the two files rather than have to maintain two copies of the
+build line.

Fixes golang/go#32212

Change-Id: I1f9ee4956183aa6248a5a2e83b5760d02532bacb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/178699
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2019-05-25 14:57:41 +00:00
Ian Cottrell
7927dbab1b internal/lsp: build the packages config on demand from proper configuration
This moves the fileset down to the base cache, the overlays down to the session
and stores the environment on the view.
packages.Config is no longer part of any public API, and the config is build on
demand by combining all the layers of cache.
Also added some documentation to the main source pacakge interfaces.

Change-Id: I058092ad2275d433864d1f58576fc55e194607a6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/178017
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-05-21 17:12:43 +00:00
Heschi Kreinick
0133cac317 cmd/goimports: reuse cached state
The internal imports API allows the user to control the lifetime of
caches, via the ProcessEnv object. Change the goimports command to use
the same cache for its lifetime. This should speed up goimports -w *.go
dramatically in cases where imports need to be added.

Change-Id: I01e3531ad53b038896435474ac9a8be97d5f3c10
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175448
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-20 21:49:40 +00:00
Ian Cottrell
b9584148ef internal/lsp: add structured layers to the cache
This is primarily to separate the levels because they have different cache
lifetimes and sharability.
This will allow us to share results between views and even between servers.

Change-Id: I280ca19d17a6ea8a15e48637d4445e2b6cf04769
Reviewed-on: https://go-review.googlesource.com/c/tools/+/177518
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-05-16 21:30:38 +00:00
Austin Clements
e31d36578a compilebench: handle missing MemStats more gracefully
Reporting MemStats requires the legacy profile format (see golang/go#18641).
This CL detects when it couldn't get the MemStats from the profile and
reports this, rather than reporting 0 allocs.

Change-Id: Ib621ad975290cf05835fafa81e8e47762d82a519
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175802
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:10 +00:00
Austin Clements
60140f0909 compilebench: add a linker benchmark
This links cmd/compile, which is the largest binary in GOROOT.

Unfortunately, this can't measure the linker's allocation metrics
prior to CL 176057 because the fix for golang/go#18641 was applied to
the compiler but not the linker.

Change-Id: Ia44d80f1d727c1608cedaa4b8ad2a05903774875
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175801
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:08 +00:00
Austin Clements
eeb76a0c47 compilebench: factor running build tool commands
We do a lot of sophisticated things around running the compile command
to gather benchmark metrics from it. We're about to add a benchmark
for the linker and will want all of the same mechanism. This CL
factors this out into a function.

Change-Id: I499d15d30417618f372982404ceb3e0f9c762e5c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175800
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:07 +00:00
Austin Clements
8a42e17289 compilebench: clean up different benchmark types
compilebench contains three different types of benchmarks and we're
about to add a fourth. Currently we dispatch based on name. This CL
cleans this up so the list of benchmarks points to how to run each
benchmark. It also joins together common error-reporting paths.

Change-Id: Icd4f77bdda9776863792dcd85f27b17829a833e6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175799
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-05-09 00:13:06 +00:00
Brad Fitzpatrick
9d4d845e86 cmd/goimports: add -format-only flag
Fixes golang/go#31745

Change-Id: I127ca4140c9db7df224b1892c43c457ac6edd646
Reviewed-on: https://go-review.googlesource.com/c/tools/+/174326
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-29 23:13:29 +00:00