In cmd/goimports, allow for the -local flag to accept a comma-separated
list of import path prefixes. Also, update the imports package
accordingly to support this.
Fixesgolang/go#19188
Change-Id: I083d584df8c3a77532f0f66e9c5d970960180e0d
Reviewed-on: https://go-review.googlesource.com/85397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Previously, the test assumed that golang.org/x/tools was always in the
first GOPATH workspace. It may not be. Find it dynamically instead.
Fixesgolang/go#19400.
Change-Id: I9c75d5ff1409aebd403d7ad4314b496fe1a04140
Reviewed-on: https://go-review.googlesource.com/94900
Run-TryBot: Dmitri Shuralyov <dmitri@shuralyov.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
In command-line mode, we were traversing the dir tree with depth
of only 1. This prevented the synopses of sub-directories from being
scanned and showed in the output when a package path was being passed.
Increasing the depth to 2 so that sub-directories of the next
level is also parsed and the synopses gets shown.
Also fixed the comment to reflect that dir can be nil only in
command-line mode now after golang.org/cl/93215
Fixesgolang/go#22646
Change-Id: I066a3bc3ba3d9d3a9589f97137e1bc4497a45473
Reviewed-on: https://go-review.googlesource.com/93675
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This addresses the build errors that caused a
revert of the original PR golang/tools#21Fixesgolang/go#23746
GitHub-Last-Rev: 6606c0b63afb4f1043b2aa2dc640edda4cf9afe8
GitHub-Pull-Request: golang/tools#25
Change-Id: Ic5a7e3054d182dc2041d2966ca68960c3abd7620
Reviewed-on: https://go-review.googlesource.com/96178
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This reverts commit db9df82880.
Reason for revert: Broke the build. I forgot to run tests, sorry.
Change-Id: I8a6ef88cac2aa638982530960f0d37a32dc5ccf0
Reviewed-on: https://go-review.googlesource.com/95875
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Apply same change as CL 94656 did for cmd/go/internal/get, but for
golang.org/x/tools/go/vcs, to help keep them in sync.
It indirectly includes changes from CL 94603, since CL 94656 was
rebased on top of CL 94603.
Updates golang/go#23867.
Helps golang/go#11490.
Change-Id: I33eca1aba19f47bbe3e83d4ef9f9cc9a9c9ae975
Reviewed-on: https://go-review.googlesource.com/94899
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
In a dynamic interface method call x.f() where x has type I, it is not sound
to assume that the receiver of the types.Signature for types.Func f has type I, as
Func objects for abstract methods may be shared by multiple interfaces.
Fixesgolang/go#23925
Change-Id: I755e3010d1310480c46855e072946346626b3e59
Reviewed-on: https://go-review.googlesource.com/95697
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
We used a css-pseudo class rule to move the line number inside
the pseudo element. The idea was to prevent line numbers from getting
selected while copying the code. But this was already implemented
with the "user-select: none" rule.
Since the spec was undefined on "user-select", we had to resort
to the pseudo-class, but now both FF and Chrome implement the correct
behavior.
Hence, moving the content to be inside the span, and removing the
pseudo-class rule.
Manually tested with Chrome 63 and Firefox 58 on Ubuntu.
Fixesgolang/go#23724
Change-Id: I3e733db766b44875ba6bc3f6985cde2559d116e2
Reviewed-on: https://go-review.googlesource.com/93975
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
The example_html was being rendered outside the ".expanded" div which
did not hide it when the parent Overview div was being hidden. Moving it
inside the div so that the behavior is consistent
Fixesgolang/go#23590
Change-Id: I75ee0af1c4074e02629b84ce366b34711e6d823b
Reviewed-on: https://go-review.googlesource.com/90396
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
In cmd/present, a mode was being passed to the function parse, but it
wasn't actually being used. Use it.
In go/ssa, checkFinalInstr received an idx integer but it doesn't
actually need it. Get rid of it.
Lastly, in imports, findImportStdlib always returned rename==false. Get
rid of that result parameter.
Change-Id: I719006b69ee80a3ef4b0ea24c1c206016a7e304b
Reviewed-on: https://go-review.googlesource.com/93596
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Previous work to resolvegolang/go#18201 increased the maximum line
length that goimports could handle to 1MiB (CL83800), but generated code
can result in Go files with longer lines. Use a bufio.Reader instead of
a bufio.Scanner to support arbitrarily long lines, as permitted by the
Go spec.
Change-Id: If719e531859804304d60a8c00db6304ab3d5fe5e
Reviewed-on: https://go-review.googlesource.com/93439
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Currently, in http mode the server blocks until the corpus
has been initialized. This can cause considerable delay
if the user workspace is significantly large and the files
are not present in the buffer cache.
This CL spawns off the initialization in a separate goroutine
if httpMode is set and turns on a flag when it's done.
The http handler checks the flag and returns an error response
if it has not been set.
The check is only performed for the path prefixes handled by the
handlerServer struct. Other paths do not call the GetPageInfo() function
and hence can return immediately. This preserves maximum responsiveness
of the server.
Also adds an additional print statement in verbose mode
Note: This is a re-do of a previous CL golang.org/cl/88695 which was
incorrect committed without running tests. This CL fixes that test.
Fixesgolang/go#13278
Change-Id: I80c801f32af007312090d3783a2ea2c6f92cad66
Reviewed-on: https://go-review.googlesource.com/93215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The .gitignore file should only list files created by the build.
Change-Id: I0cab4662e54a560851cf5d9c4b4d18c4eb9a6bb6
Reviewed-on: https://go-review.googlesource.com/93437
Reviewed-by: Rob Pike <r@golang.org>
Currently, in http mode the server blocks until the corpus
has been initialized. This can cause considerable delay
if the user workspace is significantly large and the files
are not present in the buffer cache.
This CL spawns off the initialization in a separate goroutine
if httpMode is set and turns on a flag when it's done.
The http handler checks the flag and returns an error response
if it has not been set.
The check is only performed for the path prefixes handled by the
handlerServer struct. Other paths do not call the GetPageInfo() function
and hence can return immediately. This preserves maximum responsiveness
of the server.
Also adds an additional print statement in verbose mode
Fixesgolang/go#13278
Change-Id: I0505acc1c190423d09fb199b11ca86e0400e84d4
Reviewed-on: https://go-review.googlesource.com/88695
Reviewed-by: Andrew Bonventre <andybons@golang.org>
When determining children of a parent directory, look for the expected /
to avoid processing directories that look similar but are not direct
descendants.
Fixesgolang/go#21991
Change-Id: I5c7d18076540e5588a856845f04645231856196f
Reviewed-on: https://go-review.googlesource.com/65672
Reviewed-by: Michael Matloob <matloob@golang.org>
gp/ssa: add {Start,Stop}TestLog methods to synthesized test main package.
go/ssa/interp: add (not thread-safe) intrinsics for atomic.Value,
which are now used by Getenv.
go/pointer: disable test of callbacks from runtime timers
as the analysis's intrinsics are out of date. Also fix 3 typos.
Change-Id: I25f95ba18986727275a730b465e7fd23c08b2af2
Reviewed-on: https://go-review.googlesource.com/88055
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Currently, if the blog binary is executed outside the root directory
without any additional flags, it bails out with the following error -
"open template/root.tmpl: no such file or directory"
This CL prints out a more user friendly error which allows the user to
learn that there is a flag with which the template directory can be set.
Fixesgolang/go#22622
Change-Id: I726e7c28f5e5036146769ca01516368f45a6262c
Reviewed-on: https://go-review.googlesource.com/86855
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
When selecting a sibling's import, the unresolved reference must have
been also used otherwise use the normal search to determine the best
possible package to import.
Fixesgolang/go#23001
Change-Id: I38a983569991464970ad5921fe7f280dd3e35a2c
Reviewed-on: https://go-review.googlesource.com/82875
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
When sending the request to /share, it defaulted to
application/x-www-form-urlencoded. This caused the body to be
empty since it was sending a form with the actual code as a
key in the r.Form map.
Set the content type explicitly to text/plain.
Fixesgolang/go#21691
Change-Id: I0d5981d9c9aa901010af65b0d0a7670870b77f2b
Reviewed-on: https://go-review.googlesource.com/86317
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Now that play.golang.org and sandbox[-flex].golang.org have been
merged, proxy requests to the former.
Change-Id: I7d18d0494fd54c2357dc53952fa458ceb1380aca
Reviewed-on: https://go-review.googlesource.com/86253
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This change set fixes the issue by specifying a max buffer size of ~1 megabyte for Scanner.
Previously the max was not set resulting in the default max which is ~64k. This increased max should not increase
memory use for smaller, normal files because it is a max and the code expands the buffer as needed for large tokens.
The change set includes an additional change to return an error from the Scanner which was ignored previously.
Fixesgolang/go#18201
Change-Id: I11be39af74d5eb3b353ad81ba1cb5404207aa65d
Reviewed-on: https://go-review.googlesource.com/83800
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The link to the sam documentation explaining the use
of the address syntax used when loading code files
was dead. This updates the location of the
documentation to the new plan9 site.
Fixesgolang/go#23247
Change-Id: If27702a17700ac859650e1e3c070cb43345f32b0
Reviewed-on: https://go-review.googlesource.com/85420
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This can be very helpful if you lay out each value's string
representation like this:
and // &
andAnd // &&
or // |
orOr // ||
Without the use of comments, it's impossible to use stringer with these
names as the characters & and | cannot form valid identifiers in a Go
program.
Fixes#20483.
Change-Id: I4d36c74059dd48ae3a5e09b70a429a75853ef179
Reviewed-on: https://go-review.googlesource.com/44076
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Rob Pike <r@golang.org>
Some default browser stylesheets set a border radius on <button>
elements that was not being overridden in style.css. The button
should not have any border radii on the left as it should look
like an extension of the search field.
Change-Id: I458bd2e3a903a4c1dd246ff0304e7d3cf29c0988
Reviewed-on: https://go-review.googlesource.com/83296
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This change is ported from src/cmd/cover/profile.go[1].
Now that go test supported -coverprofile with multiple packages (#6909),
x/tools/cover/profile should also handle multiple samples from the same
location.
[1]: f39050c8ebFixesgolang/go#23076
Change-Id: I1b1d664bf56f7e22c6cb2726df44fb577408c6f7
Reviewed-on: https://go-review.googlesource.com/83078
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
That's what our main XP developer has, and what our builder is.
We can't vouch for anything older. Also, IIRC, there were some
TLS/cert changes in SP3 we depended on, but I can't find the details
in quick searches.
Change-Id: I876494b2c8d201e2d1a8a74ffc6150697208af6f
Reviewed-on: https://go-review.googlesource.com/83096
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
getgo doesn't work on plan9. Skip it entirely.
And skip the massive slow godoc start-up test. Not worth it.
Change-Id: If062b7c4c8c7c5084e607ed22085657054c10ba9
Reviewed-on: https://go-review.googlesource.com/80737
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>