1
0
mirror of https://github.com/golang/go synced 2024-10-01 07:28:35 -06:00
Commit Graph

2013 Commits

Author SHA1 Message Date
Dominik Honnef
860883f6da refactor/rename: require cl-lib, use cl- namespace
go-rename.el used the cl list* macro without requiring cl. This only
worked for people who required it for other code. go-guru.el, before its
removal from the tree, changed from cl to cl-lib, indirectly breaking
go-rename.el for some users.

Switch to using cl-list* and require cl-lib.

Fixes golang/go#17468

Change-Id: I70f2052b9fd3d1a8671794d9a3954be218026af2
Reviewed-on: https://go-review.googlesource.com/31471
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-10-19 16:26:16 +00:00
Rhys Hiltner
af95c112ad go/ast/astutil: do not remove imports in AddNamedImport
When adding imports to an existing import declaration, ensure that
the target declaration will be printed with parentheses. This allows
all of the imported packages to be printed, not just the first one.

Fixes golang/go#17212

Change-Id: Ie5de5ec9bca6169650336ee2ea98334817e64e48
Reviewed-on: https://go-review.googlesource.com/29688
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-18 18:48:44 +00:00
Alan Donovan
69f6f5b782 cmd/guru: remove Emacs support, now at github.com/dominikh/go-mode.el
Change-Id: I4350331b4f047b7388c274157ecbd49a582cf091
Reviewed-on: https://go-review.googlesource.com/30991
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-13 18:55:30 +00:00
Alan Donovan
ab8f7d902d cmd/guru: remove Vim support, now at github.com/fatih/vim-go
Change-Id: I94f478e32f358fd23dc187fcfbca9c05bf7da576
Reviewed-on: https://go-review.googlesource.com/30990
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-13 18:54:40 +00:00
Alan Donovan
2f93937767 x/tools: s/oracle/guru/g in various comments
Change-Id: Ie0da80db4f58d9f6e7d9675c89f106d1cd01710a
Reviewed-on: https://go-review.googlesource.com/30983
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-13 18:54:04 +00:00
Alan Donovan
d9f9484612 cmd/oracle: oracle is dead, long live guru
Change-Id: I0f729b1477d8b14f255538414087d25f99b20c1e
Reviewed-on: https://go-review.googlesource.com/30982
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-13 18:53:55 +00:00
Russ Cox
b44548ae6a go/vcs: accept plain file for .vcs (instead of directory)
Sometimes .git is a plain file; maybe others will follow.

Fixes golang/go#10322.

Change-Id: Id57424998c207080c3ed5826b1e5e091fa26aad5
Reviewed-on: https://go-review.googlesource.com/21430
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-13 13:57:49 +00:00
Brad Fitzpatrick
a2b1312ca0 cmd/godoc: increase test timeout
Darwin was flaking. Its HFS filesystem is probably too slow.

Change-Id: I44ea6de8dae8054d41c94c0c36e703e62fbdfcd9
Reviewed-on: https://go-review.googlesource.com/30954
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-10-12 16:04:38 +00:00
Alan Donovan
992f6f9bcc go/loader: fix CreateFromFilenames example
The "sort" package is no longer quite as low-level as it once was.

Change-Id: Ic62d780841ef1172f65d4c00ec500994f94cb4b7
Reviewed-on: https://go-review.googlesource.com/30931
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-12 15:34:52 +00:00
Brad Fitzpatrick
41f4ee4e59 cmd/godoc, cmd/fiximports: fix or skip failing tests at tip
Fix godoc test failure.

Skip fiximports test failure for now, to not hide other
failures. (tracking bug to fix properly in golang/go#17417)

x/tools being broken is preventing use of trybots for unrelated CLs.

Change-Id: I3a1deee4036096e0377cf8b63fabe444c58dd86e
Reviewed-on: https://go-review.googlesource.com/30953
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-10-12 15:24:30 +00:00
David R. Jenni
f4e1751b91 go/ast/astutil: handle documentation of imports in DeleteNamedImport.
If the parens of an ast.GenDecl are dropped, move the documentation
of the ImportSpec above the import statement, otherwise the the
code is invalid.

Fixes golang/go#15432.

Change-Id: I715750b8f528380b96a6bc8b5f216043937976c2
Reviewed-on: https://go-review.googlesource.com/22415
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-12 15:09:30 +00:00
Syohei YOSHIDA
5e567c6dff cmd/guru: emacs: Use cl-lib.el instead of cl.el
This package requires cl-lib.el in package header but it is not loaded
and cl.el functions are used instead of cl-lib functions. Using cl.el
functions causes byte-compile warnings.

Change-Id: I6d9400f9ced6a5cc0592d83da2ab1c1cf34e20b8
Reviewed-on: https://go-review.googlesource.com/27031
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-10-12 14:21:26 +00:00
Francesc Campoy
8453f27cc7 present: make code in slides editable only with -edit
Also added a suite of tests and fixed a minor bug that
caused a panic when the .code command specified HL with
no text after.

Fixes golang/go#17379.

Change-Id: I3c246523c3d4010bf76a467ee648475255090e1b
Reviewed-on: https://go-review.googlesource.com/30691
Reviewed-by: Rob Pike <r@golang.org>
2016-10-07 20:29:58 +00:00
Tamir Duberstein
4c4edc0bec cmd/goyacc: remove hardcoded NTYPES
Updates #16144.

Change-Id: I196dd4e871c88792ea95c02b31c54f269fdc505f
Reviewed-on: https://go-review.googlesource.com/27350
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-10-07 17:45:45 +00:00
Robert Griesemer
b5358b5fee go/gcimporter15: update exportdata.go to match latest version from std lib
For golang/go#17281.

Change-Id: I7bed233368939719672eb331cca1d6aef01e807d
Reviewed-on: https://go-review.googlesource.com/30591
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-10-06 19:19:18 +00:00
Alan Donovan
03663480fa go/buildutil: ExpandPatterns: ignore a trailing slash in a pattern
Previously, a trailing slash would cause "foo/" to be treated as the
name of a package, with comical results.

Fixed golang/go#14584

Change-Id: I660f8a079bbd63d3645812e516a9264c8e080e61
Reviewed-on: https://go-review.googlesource.com/30452
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-05 19:34:25 +00:00
Alan Donovan
27f88d9b7a cmd/guru: if query file is not beneath GOPATH, treat it as a package
This allows type-based guru queries to work on arbitrary files at the
root or even outside of a GOPATH workspace (as "go run foo.go" does).

Fixes golang/go#15797

Change-Id: I2be28f7259448e6398aae84d6ae7e71d8649967a
Reviewed-on: https://go-review.googlesource.com/30451
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-05 18:29:27 +00:00
Mohit Agarwal
73d2e795b8 cmd/godoc: fix command for creating the zip file
The `-r` option (to recurse into directories) need to be specified
else the created file consists only of the specified directory and
nothing else.

Change-Id: I624184fc2e88998a3119c12f8c328603588c123c
Reviewed-on: https://go-review.googlesource.com/17283
Reviewed-by: Russ Cox <rsc@golang.org>
2016-10-04 20:51:58 +00:00
Francesc Campoy
471a6e15ec godoc: drop outdated comment
Change-Id: I2a4d0c112575cad70180ba0f8984a271a7658775
Reviewed-on: https://go-review.googlesource.com/29686
Reviewed-by: Sameer Ajmani <sameer@golang.org>
2016-10-04 17:46:36 +00:00
Alan Donovan
fc2b74b64e refactor/rename: don't stop because of "soft" errors
Because go/types is slightly more strict than gc about certain "soft"
errors (ones that aren't necessary to interpret a Go program), gorename
rejects programs that compile under gc.  This change relaxes gorename's
error checks so that they are weaker than gc's.

This is a workaround for issue golang/go#14596 in gorename,
whose underlying problem is issue golang/go#8560 in gc.

Fixes golang/go#14596

Change-Id: Ica5006c2376c0564a575224269093c1497348ee6
Reviewed-on: https://go-review.googlesource.com/29853
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-27 16:36:09 +00:00
Rhys Hiltner
c2ef61f450 go/ast/astutil: fix loop logic in AddNamedImport
When merging import declarations into a single block, AddNamedImport
modifies the list of declarations in the provided file while
iterating over the list. Take care to adjust the index into the list
so as to not skip entries or fall off the end.

Fixes golang/go#17213

Change-Id: I807246f762c965ea1fc51eb57759f6088336db86
Reviewed-on: https://go-review.googlesource.com/29681
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-24 00:48:36 +00:00
Francesc Campoy
3f4088edb4 godoc: avoid exposing absolute paths on 404
Exposing the full paths to files is considered possible
source of vulnerabilities.

Change-Id: Ie9ae3791e51fcff5f1df711f84db9879d7e6ce37
Reviewed-on: https://go-review.googlesource.com/29445
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-21 00:04:58 +00:00
Brad Fitzpatrick
f1a397bba5 cmd/bundle: add flag to rewrite golang.org/ to golang_org/ in imports
I've been doing this by hand since Go 1.7rc2.

Updates golang/go#16333

Change-Id: Ib12c013b14210123d48d6ad78922caf1286c20cc
Reviewed-on: https://go-review.googlesource.com/29086
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-09-13 16:37:30 +00:00
Dominik Honnef
5ffc3249d3 present: dont crash if address searched backwards
For /start/,/end/, the /end/ address can wrap around and match somewhere
before /start/. Handle this case without crashing.

Fixes golang/go#7163.

Change-Id: I6fc3b5048e88728c9403a1d1e284ea8ada567a1e
Reviewed-on: https://go-review.googlesource.com/21182
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-09-13 12:21:10 +00:00
Alan Donovan
86ad1193da go/ssa/interp: turn {strings,bytes}.init into no-ops
...to avoid executing the supportAVX2 assembly function.

Also, combine all no-op intrinsics into a single function.

Change-Id: Ic65a80d3a6df52c3850c34406f034781057a0991
Reviewed-on: https://go-review.googlesource.com/28711
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-09-07 20:36:55 +00:00
Robert Griesemer
9deed8c6c1 go/gcimporter15: update to recognize export format version 2
Port of https://go-review.googlesource.com/#/c/27999/.

Change-Id: I71c4553e925fcf943ecafdef307591f63136d432
Reviewed-on: https://go-review.googlesource.com/28001
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-08-29 18:38:39 +00:00
Robert Griesemer
a832035fe5 go/gcimporter15: update to match latest changes to cmd/compiler exporter
Backport of https://go-review.googlesource.com/27814 changes to
bexport.go.

With this, the gcimporter15 is again up-to-date and in sync with both
the compiler's export code, and the compiler's and std lib gcimporter's
import code.

Change-Id: I8e229660eb78ddc1506b7b96a89c81ff083e0412
Reviewed-on: https://go-review.googlesource.com/27914
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-08-26 22:16:59 +00:00
Robert Griesemer
e545a4ce60 go/gcimporter15: update to match latest changes to std lib gcimporter
Mostly a backport of https://go-review.googlesource.com/27816.
Includes an update to TestIssue13898 to match the std lib gcimporter
test.

Change-Id: I790123a49deb2d52f19e51c84bbc7ee74c99156e
Reviewed-on: https://go-review.googlesource.com/27913
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-08-26 22:16:48 +00:00
Dmitri Shuralyov
5cb1c80a83 cmd/bundle: Support renaming imports.
Document a risk of generating invalid code due to shadowing between
identifiers in code files and the imported package names.

This risk was present before for any package with more than 1 .go file,
but it's increased when some files have renamed imports (since they're
typically used to resolve shadowing conflicts).

Resolves TODO(adonovan): support renaming imports.

Change-Id: Ie0e702345790fd2059c229623fb99fe645d688a4
Reviewed-on: https://go-review.googlesource.com/23785
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-08-24 17:03:01 +00:00
David R. Jenni
6e2a0ce36e cmd/guru: show correct definition for embedded type.
Fixes golang/go#16263.

Change-Id: I081a12306ac5415d2223e3509a29a1b47700e1ff
Reviewed-on: https://go-review.googlesource.com/27001
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-08-24 12:03:13 +00:00
Robert Griesemer
b2560d12f6 go/gcimporter15: backport compiler exporter fix for golang/go#15514
Code from https://go-review.googlesource.com/#/c/27639/ .

Remain backward-compatible with possibly installed packages
that remain in Go1.6 format.

Change-Id: If424e7a881c81bbfcacf38c0946542793c406abd
Reviewed-on: https://go-review.googlesource.com/27640
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-08-23 23:43:11 +00:00
Robert Griesemer
2bbdb4568e go/gcimporter15: update to match std lib gcimporter (fix build)
TBR=adonovan

Change-Id: Ib2464def48932e0d0fc24f67c76a10e8918acb9d
Reviewed-on: https://go-review.googlesource.com/27235
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-08-23 00:37:51 +00:00
Konstantin Shaposhnikov
8ea9d46069 refactor/rename: do not allow a new name to be a keyword
Fixes golang/go#16535

Change-Id: I46f9b9530e25bb286557712a7969715f8dde99b9
Reviewed-on: https://go-review.googlesource.com/25343
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-08-20 16:15:16 +00:00
Tamir Duberstein
df703d6484 cmd/goyacc: remove unused constants
Change-Id: I48002d39de6d32ee9410fd4271f623b5661f0081
Reviewed-on: https://go-review.googlesource.com/27328
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-18 16:45:58 +00:00
Brad Fitzpatrick
f1ba7e38e5 cmd/goyacc: move go tool yacc from the go repo
This moves the 'go tool yacc' command from the main Go repo
to x/tools.

Copied from go rev 795ad07b3 + doc changes from "go tool yacc" to "goyacc".

Updates golang/go#11229

Change-Id: I6d17911a3bf64724c090c4fe4903238e3bce3b8c
Reviewed-on: https://go-review.googlesource.com/27324
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-08-18 15:37:45 +00:00
Robert Griesemer
1cf0a337cd go/gcimporter15: don't run 1.7-specific test under 1.8 (fix build)
TBR=adonovan

Change-Id: I310ff6e51d681b2e5c8288e73870ce7d68e45518
Reviewed-on: https://go-review.googlesource.com/27208
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-08-17 05:10:56 +00:00
David R. Jenni
491cbb1158 go/ast/astutil: add tests for UsesImport.
Change-Id: I05e9897b2ac858e1c3cc0d54f9da74e34f72f9e2
Reviewed-on: https://go-review.googlesource.com/27002
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-16 21:44:40 +00:00
Michael Matloob
08b1e0510c x/tools/cmd/heapview: add a sidebar to hold navigation
This change also puts more structure into the viewer.
Adds an enum for events that we'll issue and a few more elements
to organize things.

Change-Id: I39c7c53422779348ca05f051c6b0b07d22ad6a00
Reviewed-on: https://go-review.googlesource.com/26656
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-08-16 17:33:40 +00:00
Brad Fitzpatrick
3fe2afc9e6 imports: update zstdlib to Go 1.7
Change-Id: I936c6f03e8c3dc14832c8493937fdb64e6d1a853
Reviewed-on: https://go-review.googlesource.com/27079
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-08-15 22:30:11 +00:00
Chris Broadfoot
c66da98c4f imports: don't use fastpath on appengine (syscall not available)
Change-Id: I02fbdf1a08894b35a19a3638357c0d42e64d42cc
Reviewed-on: https://go-review.googlesource.com/27078
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-15 22:01:42 +00:00
Tamir Duberstein
0e9f43fcb6 cmd/goimports: work around lack of runtime/trace in gccgo
Moves runtime/trace support (including its command line flag) behind
a "gc" build tag to allow goimports to build under gccgo, which does
not support runtime/trace.

Updates golang/go#15544.

Change-Id: I017a44089c0a4f3d3ba98815d57a141e25b3fe56
Reviewed-on: https://go-review.googlesource.com/26998
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-13 05:07:58 +00:00
Michael Matloob
68cf18548e x/tools/cmd/heapview/internal/core: stub mmapfile for !darwin,!linux
mmapfile.go uses symbols in the syscall package that are not defined
on windows and some other operating systems. Temporarily
buildtag-restrict mmapfile to darwin and linux (the platforms easiest
for me to test) to fix the build.

Change-Id: Ib056608a655b6d32170cd86deac785811e7bc0d1
Reviewed-on: https://go-review.googlesource.com/26830
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-11 13:58:04 +00:00
Brian Kennedy
62f0028207 imports: properly handle global variables when creating imports
Fixes golang/go#7463

Change-Id: Ib8b511a34c562a2b3cdce6bb143caa7cf453bd00
Reviewed-on: https://go-review.googlesource.com/23444
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-11 06:06:14 +00:00
Michael Matloob
855bbc50ad cmd/heapview: add an internal core package for reading cores
This is based on github.com/tombergan/goheapdump/heapdump.

This CL mostly just copies over the 'raw' data structures based
on the profiler records' data structures. Many of them may need
to be changed, but I think it will be good to have these definitions
here to provide a base.

Change-Id: I609202b6b87d980b0835c8087b3d78e11bd6dfe3
Reviewed-on: https://go-review.googlesource.com/25584
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-08-09 19:00:08 +00:00
Michael Matloob
29462195f2 x/tools/cmd/goimports: define verbose flag in parseFlags
This will allow users to use a different flag name.

Change-Id: I252871b8efb6867e61ca507f59a9663cb7140b7d
Reviewed-on: https://go-review.googlesource.com/26632
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-09 18:14:46 +00:00
Michael Matloob
72064bd647 cmd/heapview: dowgrade to customelements v0
I've had too many issues with customelements v1. The interface for v0
isn't as nice, and v0 will eventually be deprecated. But v1's polyfill
library is better supported, and it will be easy to upgrade later.

Change-Id: I87b376376b750167a0464c6c249930edecbd59db
Reviewed-on: https://go-review.googlesource.com/25545
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2016-08-05 20:49:36 +00:00
Michael Matloob
337c0124d7 x/tools/cmd/heapview: add a heading to the page
This CL's purpose is to introduce the dependency on the HTML Custom
Elements polyfill. Like we've done so far, I'm trying to keep
dependencies light by using current or polyfilling future webcomponents
standards.

Change-Id: I11d14db367b697cdd527fb66b9d7d160ac244b78
Reviewed-on: https://go-review.googlesource.com/25494
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-05 01:00:25 +00:00
Michael Matloob
7ef02fdb22 cmd/heapview: add karma+jasmine TS unit testing config
Add a configuration that allows unit testing of client Typescript
code using Karma and Jasmine. Add a basic test to exercise this.

Change-Id: I88af82b68547423efeaafb0fab8214ed39573ee9
Reviewed-on: https://go-review.googlesource.com/25411
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Evan Martin <evanm@google.com>
2016-08-03 18:16:31 +00:00
Miroslav Genov
bf0c35b6b6 tip/doc: update doc to match latest gcloud syntax
gcloud command no longer requires preview for deployment and is showing
warning when command is executed:

```
WARNING: The `gcloud preview app` command group is deprecated; please
use the `gcloud app` commands instead.
```

This change is removing "preview" text from README to make deploy
command up to date with gcloud.

Change-Id: I64d390ab4891f82fe608c64be20fae01a80d00fc
Reviewed-on: https://go-review.googlesource.com/25430
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-03 14:42:34 +00:00
Michael Matloob
9e7459099f x/tools/cmd/heapview: break out init code
This change breaks out the code that adds handler funcs and
starts the HTTP server into separate functions, so that they
can be overridden in other environments, such as Google's.

For instance, listenAndServe can be overridden in an init method
in a different file to use a HTTP2 server.

Updates golang/go#16410

Change-Id: I074242af10486c60c374e9ac7ebe9d0e61a8fa22
Reviewed-on: https://go-review.googlesource.com/25273
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-07-27 17:11:33 +00:00