1
0
mirror of https://github.com/golang/go synced 2024-11-05 20:16:13 -07:00
Commit Graph

887 Commits

Author SHA1 Message Date
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
LE Manh Cuong
681f9ce8ac cmd/compilebench: update document
Add document for "-go" and "-short" flag, which are listed in output of
"compilebench help".

Also reformat "-pkg" document to align with the rest.

Change-Id: I8ce80d8e02a9cf2b94aa099aa34e53412210d61b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170237
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2019-04-11 18:01:16 +00:00
Tobias Klauser
7e5bf9270d cmd/getgo: fix build on aix
Change-Id: Ic4a2f8f32258b14354658af5a09c736404d38808
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170961
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-10 13:57:22 +00:00
Rebecca Stambler
719e078ade cmd/gopls/integration/vscode: log diagnostics as they are received
This change will allow us to investigate golang/go#30786 more easily.
Diagnostics are getting stuck even though they appear to be being sent
in the correct order, so it will be helpeful to see what's happening on
the VSCode side.

Change-Id: I623fcd9979c05decb0a6f60da2f75af7d0ff3853
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170895
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-04-06 23:58:00 +00:00
Bryan C. Mills
052fc3cfdb cmd/auth/cookieauth: add a GOAUTH implementation that reads from a cookiefile
Updates golang/go#26232

Change-Id: Ic8a7336eeb395fb9e8bbb7589a98a402deed0501
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161669
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:40 +00:00
Bryan C. Mills
aafdb068a0 cmd/auth/netrcauth: add a reference GOAUTH implementation using .netrc files
Updates golang/go#26232

Change-Id: Ic6e0003be518e37927a25552b23da4f62eb1072d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161668
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:24 +00:00
Bryan C. Mills
e32fe8a1b3 cmd/auth/gitauth: add a reference GOAUTH implementation using 'git credential fill'
Updates golang/go#26232

Change-Id: Ic22722756df1e66551222a8834a152519cb39e24
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161667
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:12 +00:00
Bryan C. Mills
50503db0be cmd/auth/authtest: add a manual-test harness for GOAUTH implementations
Updates golang/go#26232

Change-Id: Idd6d32f4fcb99172a31e50fbd5993d563839c530
Reviewed-on: https://go-review.googlesource.com/c/tools/+/161666
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-04-05 18:06:07 +00:00
Roger Peppe
63e6ed9258 cmd/stringer: compile error when constants change
When constant values change but stringer has not
been run again, we can get misleading string values.
Protect against this by generating code that will fail
with a compiler error when this happens.
Most compilers should be smart enough to omit the
code containing the checks.

Change-Id: I7a36d20f014cba0e7d88851d1b649a098ee30d76
Reviewed-on: https://go-review.googlesource.com/c/tools/+/163637
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2019-03-18 00:52:22 +00:00
Brad Fitzpatrick
658e28e1e6 cmd/stringer: add temporary(?) fix to get stringer test working in module mode
Updates golang/go#30874

Change-Id: I170ea99b3f06c8bc4cc624e86b80eeb852ea7115
Reviewed-on: https://go-review.googlesource.com/c/tools/+/167771
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-15 20:35:58 +00:00
Josh Bleecher Snyder
4ccd092f47 cmd/compilebench: generate separate mem profiles when using -count
When the -count flag is provided,
instead of having each run overwrite the previous profile,
add a count suffix to the profile filename.

Then you can combine the profiles with

go tool pprof `go tool -n compile` <all profile files here>

This was done for CPU profiles in https://golang.org/cl/39718.

Change-Id: I4aa66d745fe18088655fc1d9cf3ecf29f68370bb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/166523
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2019-03-14 00:31:01 +00:00
Dmitri Shuralyov
bd17c084df godoc/env: replace with golangorgenv
This change replaces the env package with a new golangorgenv package.

The previous env package existed primarily to configure the godoc
instance that was running golang.org. By now, the golang.org website
has been factored out to x/website, which has its own env package,
but ends up still using this env package indirectly via x/tools/godoc.

The goal of this change is to make env available for other services
that run on subdomains of golang.org, so they can continue to safely
rely on the x/tools/playground, which will be modified in the next
commit to also use the new golangorgenv.

The golangorgenv package replaces the IsProd function with a more
specific one. Start using it in packages x/tools/{,cmd}/godoc. Also,
re-arrange the order of checks to give the host suffix check higher
priority than the environment variable check. This way, if the
environment variable isn't set, the host suffix check gets a chance
to run.

When getting the value of "X-AppEngine-Country" header, use its
canonical format "X-Appengine-Country" to avoid an allocation.
This does not change behavior.

Updates golang/go#30486

Change-Id: I97b47211a45ca0351f31fcb4fa6d408a4b0c4c7c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/165459
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-07 16:39:06 +00:00
Elias Naur
ab489119c5 cmd/godoc,cmd/gorename,refactor/rename: skip tests on GOOS=android
Change-Id: I7a493ba4c41dddb3049a8e62198d87749fb72f62
Reviewed-on: https://go-review.googlesource.com/c/tools/+/165719
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-06 15:27:20 +00:00
Gordon Tyler
2dc4ef2775 cmd/guru: fix guessImportPath for Windows
Import paths in Go use forward slashes, not the operating system's path separator.

Fixes golang/go#24699.
Fixes golang/go#23318.

Change-Id: I190224f6b7236e8ee19893f3589dd9686cbf116a
GitHub-Last-Rev: 751b29ca5f2e52ee1124c4baca6e45eecf4a3052
GitHub-Pull-Request: golang/tools#56
Reviewed-on: https://go-review.googlesource.com/c/151057
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-02-25 23:45:24 +00:00
Rebecca Stambler
69f75a3b06 cmd/golsp: remove golsp binary, since we've moved to gopls
We left the golsp binary for a few weeks after migrating to gopls.
Remove it now.

Change-Id: Iad44a3c9cf1427be6e2d81cc7a8e9fc60ef6ee50
Reviewed-on: https://go-review.googlesource.com/c/163779
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-02-25 22:51:37 +00:00
Dmitri Shuralyov
b4f3f03986 cmd/godoc: remove golang.org serving code
The code to serve the golang.org website has been moved to
the golang.org/x/website sub-repository. x/website has become
the canonical source of the golang.org website as of CL 162157,
and so this code can be removed from here now.

This has the benefit of removing some external dependencies
that were only used by the website in production mode, and
in turn enabling x/tools to be a smaller tools-related module.

In future changes, the golang.org/x/tools/cmd/godoc command
will be reduced in scope to be a tool for serving Go package
documentation only, not the rest of the golang.org website.

Run go mod tidy (using Go 1.12 RC 1).

Updates golang/go#29206
Updates golang/go#29981

Change-Id: I61fd25627d0506901b04688dea8d8c9da9fe8f04
Reviewed-on: https://go-review.googlesource.com/c/162400
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Channing Kimble-Brown <channing@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
2019-02-20 19:02:57 +00:00
Rhys Hiltner
f000d56b39 cmd/godoc: fix -url flag, add tests
This change adds a small number of integration tests for the godoc
command's -url flag, confirming that the behavior matches the local http
server tests in those cases. It fixes three bugs which prevent the -url
flag from working currently.

Fixes golang/go#30259
Fixes golang/go#30260
Fixes golang/go#30261

Change-Id: I0ca1fe81f9f186d0ca02b31674cc8654af434e92
Reviewed-on: https://go-review.googlesource.com/c/162907
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-19 13:52:30 +00:00
Dmitri Shuralyov
0a7d439b5f cmd/godoc: re-add documentation for flat presentation mode
The documentation of the "flat" presentation mode was removed
inadvertently as part of post-CLI-removal documentation cleanup
in CL 143077. The FlatDir flag still exists and is supported.
This change re-adds it to cmd/godoc documentation.

Also fix a typo in the "src" presentation mode description.

Updates golang/go#25443

Change-Id: If4705d70bc5eafee92cdfd52409aca4606a0efd7
Reviewed-on: https://go-review.googlesource.com/c/162984
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-02-19 03:57:21 +00:00
Ian Cottrell
44bee7e801 internal/lsp: changing server noun to serve verb
Also adding in --remote support and using it to implement the equivalent
functionality of the external forward command
Also adding in --listen as a replacement for --port as it is more flexible,
specifically it allows localhost:port which
is helpful in environments where opening remotely accesible ports is
problematic.

Change-Id: I5de1cea7dd6f1ee46e7423f3be2a4caca6f040b2
Reviewed-on: https://go-review.googlesource.com/c/161658
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-02-11 22:49:14 +00:00
Jonathan Amsterdam
b2f7fe607d cmd/stringer: type check using export data
Use go/packages to find and type check packages using export data.

In addition to type checking with export data, this should also enable
cmd/stringer to work correctly when using go modules.

jba: took over CL, tweaked package.Config use.

Change-Id: Ie253378b52fbd909f7194dfd09c039aab63dd8f0
Reviewed-on: https://go-review.googlesource.com/c/126535
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-02-04 22:01:59 +00:00
Rebecca Stambler
d810ce9e47 cmd/guru: remove Go 1.9 handling, since we no longer support 1.8
Some tests were split off for Go 1.9, when we still supported Go 1.8.
This change recombines them and removes the special handling for 1.9.

Fixes golang/go#24421

Change-Id: Ic871f4c3af4bb90b00cdd6d7b8f3253783554535
Reviewed-on: https://go-review.googlesource.com/c/161000
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2019-02-04 19:56:32 +00:00
Rebecca Stambler
51e363b66d internal/lsp: implement diff for computing text edits
Rather than replacing the whole file on gofmt or goimports, use the Myers
diff algorithm to compute diffs for a file. We send those back as text
edits.

Change-Id: I4f8cce5b27d51eae1911049ea002558a84cdf1bf
Reviewed-on: https://go-review.googlesource.com/c/158579
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-02-01 23:18:25 +00:00
Brad Fitzpatrick
0e05534988 cmd/tip: delete
The cmd/tip program moved to x/build (along with its history) in:

  https://go.googlesource.com/build/+/63986c177d1ff5d2629840f6b00c445f1cb932bf

(There's no associated Gerrit CL; the merge commit of x/build's old
HEAD + a git-filter-branch of x/tools's cmd/tip was pushed directly to
Gerrit's git server, without creating Gerrit CLs for review for each
commit in its history)

Updates golang/go#29981

Change-Id: I16b9b1b0079e3d7b6851cb3e7322a878ece73e23
Reviewed-on: https://go-review.googlesource.com/c/160817
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-01 18:59:10 +00:00
Michael Matloob
3c4dfba64b cmd/heapview: delete
This is all dead code that never went anywhere.

Change-Id: I79db05d6391709bb9ae3d86f557246f1dd3b21f7
Reviewed-on: https://go-review.googlesource.com/c/159957
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-28 22:39:01 +00:00