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

499 Commits

Author SHA1 Message Date
Alan Donovan
2336c53cf0 cmd/guru: compute referrers as packages are type checked
This CL makes little observable difference to the behavior but paves the
way for streaming 'referrers' and (later) 'implements' queries which
scan the entire workspace, but print each result as soon as it is found.

The go/loader package now exposes a hook, AfterTypeCheck, that lets
clients inspect each package as soon as it is type-checked, and also
modify it, for instance to release unneeded data structures.

A 'referrers' query applied to an exported object must scan the entire
workspace.  It uses this hook so to gather uses of the query object in
streaming fashion.  However, for now, it still accumulates the results
and prints them all at the end, though I propose to change that in a
follow-up.

Code details:
- The referrers logic had a 2-iteration loop to load first the query
  package and then if necessary the enlarged program.  The second
  iteration has now been unrolled and split into globalReferrers.
- Queries for package names (whether in a package declaration or
  a qualified identifier) have been split off into packageReferrers.
  It now loads all direct importers of the query package,
  which catches some references that were missing before.
  (It used to inspect only the forward dependencies of the query
  package.)

Also:
- Referrers.Pos (the position of query identifier) was removed from the
  JSON output.  It's a nuisance to compute now, and it's already
  absent from the plain output.
  (In a follow-up, I plan to simplify the information content of the
  JSON output exactly what is currently printed in the plain output.)

Change-Id: Ia5677636dc7b0fe4461a5d393107665757fb9a97
Reviewed-on: https://go-review.googlesource.com/19794
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-04 21:13:08 +00:00
Alan Donovan
3dafbd1ba4 go/types/typeutil: make IntuitiveMethodSet(*C) nonempty for concrete types C
This fixes a bug in guru describe.

Also, add a test of IntuitiveMethodSet.

Change-Id: Ied3780807afd88e664fdb186619499670529fe33
Reviewed-on: https://go-review.googlesource.com/20166
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-03 19:43:35 +00:00
Alan Donovan
6c84e9e3e0 cmd/guru: make fastQueryPos indirect through the -modified map
This fixes a bug in which guru reports a "query position beyond end of
file" error when making a query from an unsaved editor buffer at an
offset greater than the length of the file on disk.

Change-Id: I908c024d8dd14baa657b4227e3231fa760443732
Reviewed-on: https://go-review.googlesource.com/20167
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-03 19:00:43 +00:00
Alan Donovan
6f233b96df cmd/guru: fix nil dereference in describe
+ test

Fixes issue golang/go#14579

Change-Id: I6fd56f10c170027f06917935ccbc28490d413d8a
Reviewed-on: https://go-review.googlesource.com/20100
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-03-01 22:59:02 +00:00
Konstantin Shaposhnikov
a917fb9d7b cmd/guru: emacs: package.el compatibility changes
Make go-guru compatible with package.el prior to uploading this pacakge to
MELPA.

Also add ;;;###autoload magic comments, so that the go-guru-xxx commands can
be used without need to explicitly (require 'go-guru) first.

Change-Id: I21c7f5f354fb7b39877a05c2a9ffecd02ab022f6
Reviewed-on: https://go-review.googlesource.com/19789
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-26 04:34:18 +00:00
Alan Donovan
2327a65811 cmd/guru: fix tests
A consequence of CL 19747 was that ad hoc packages of a single filename
are no longer valid -scope arguments, which broke most of the tests.

This CL fixes the tests by extracting the import path from the filename.
The test output now includes the import path, not the package
name, of each of these packages, so the output was updated too.

Also, the -scope argument caused the main package to be imported twice,
once as main.go and once under its import path, causing duplicate
'implements' results.

I'm not sure how I failed to notice this.

Change-Id: I6fb3ae3e1497f0eb8cf88f453660b9e2fd9718d8
Reviewed-on: https://go-review.googlesource.com/19886
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-25 22:51:33 +00:00
Alan Donovan
f7268ab39b cmd/bundle: fix broken test
Change-Id: I95bd6cd1b63a1d1b5bd255546fbf571010a67266
Reviewed-on: https://go-review.googlesource.com/19745
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-22 20:47:44 +00:00
Alan Donovan
3f95c66345 cmd/guru: allow foo/... and -foo patterns in scope argument
Also, document -scope argument.

Depends on CL 19746 (buildutil.ExpandPatterns)

Change-Id: I3c9000e94d87cca5c2c49fe8de12a77fc43f7257
Reviewed-on: https://go-review.googlesource.com/19747
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-22 20:17:58 +00:00
Alan Donovan
a69e659f44 cmd/guru: fix mode map, again
Change-Id: Ic1fef2e237205ed392912601324415af625417b0
Reviewed-on: https://go-review.googlesource.com/19749
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-22 20:17:02 +00:00
Konstantin Shaposhnikov
54fa7477e2 cmd/guru: emacs: do not shrink results window
This fixes the following usability issues:

- when go-guru is called twice in a row and the output from the second invocation
  is bigger then this output is not fully visible
- output window could be re-used by other packages (such as helm) that are not
  usable with the shrank window

Change-Id: I86d522006d29e945a71b96c9d13a1a39572bdb3b
Reviewed-on: https://go-review.googlesource.com/19780
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-22 15:47:11 +00:00
Alan Donovan
86372b3255 cmd/guru: use byte (not rune) count in -modified archive
Change-Id: I7fc575c8ec7a8170e64719419079d6742f47b119
Reviewed-on: https://go-review.googlesource.com/19744
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-21 19:51:54 +00:00
Alan Donovan
b0452eeec4 cmd/guru: fix bug in mode map caused by bad merge
Change-Id: I2c4ff577f744e168a7914d15269636092ceef5a9
Reviewed-on: https://go-review.googlesource.com/19748
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-21 01:08:56 +00:00
Alan Donovan
4828f5cb61 cmd/guru: emacs: minor changes to keybindings
Major modes should use the C-c prefix followed by C-something.  We'll
stick with C-o (oracle) since C-g is taken by go-jump-xxx (and in any
case C-g should be reserved for keyboard-quit.)

Change-Id: I18f41d7cbd5bf83aa53909554501e7f76543f033
Reviewed-on: https://go-review.googlesource.com/19510
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-21 00:47:43 +00:00
Alan Donovan
ee8cb08bfe cmd/guru: what: report identifiers equivalent to the selected one
This information is useful for editor UIs that highlight all
uses of the local variable under the cursor.

Change-Id: I718d648d407468509e6d12f932ae6cdef368830a
Reviewed-on: https://go-review.googlesource.com/19512
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-20 21:18:35 +00:00
Russ Cox
bf084ef758 imports: add support for vendor directories
Editor modes that invoke the goimports command on temporary copies
of actual source files will need to invoke goimports -srcdir now to say
where the real source directory is. Otherwise goimports will not consider
vendored or internal packages when looking for new imports.

In lieu of a test for cmd/goimports (because it has no tests),
a command transcript:

	$ cd /tmp
	$ cat x.go
	package p
	var _ = hpack.HuffmanDecode
	$

	$ GOPATH= goimports < x.go
	package p

	var _ = hpack.HuffmanDecode
	$ GOPATH= goimports x.go
	package p

	var _ = hpack.HuffmanDecode
	$

But with the new flag:

	$ GOPATH= goimports -srcdir $GOROOT/src/math < x.go
	package p

	import "golang.org/x/net/http2/hpack"

	var _ = hpack.HuffmanDecode
	$ GOPATH= goimports -srcdir $GOROOT/src/math x.go
	package p

	import "golang.org/x/net/http2/hpack"

	var _ = hpack.HuffmanDecode
	$

The tests in this CL and the above transcript assume that
$GOROOT/src/vendor/golang.org/x/net/http2/hpack exists.
It did in 40a26c9, but it does not today.
It will again soon (once Go 1.7 opens).

For golang/go#12278 (original request).

Change-Id: I27b136041f54edcde4bf474215b48ebb0417f34d
Reviewed-on: https://go-review.googlesource.com/17728
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-02-18 16:47:46 +00:00
Russ Cox
d0c9d43af1 bundle: new docs, command-line interface
Before, "bundle -help" printed only one not particularly useful line:

	Usage of bundle:

and "bundle" printed a bit more but not a standard usage message:

	bundle: Usage: bundle package dest prefix

	Arguments:
	 package is the import path of the package to concatenate.
	 dest is the import path of the package in which the resulting file will reside.
	 prefix is the string to attach to all renamed identifiers.

And most of that output belonged in (but was missing from) the doc comment,
which leaned heavily on the reader inferring usage from one example.

While fixing all this, I ended up dropping "dest" and "prefix" as required
arguments: perfectly good defaults can be inferred in the common case
where the bundle is intended for the current directory. The defaults can be
overridden with the new -dst and -prefix option.

I corrected a TODO about not assuming the package name could be
derived from the destination import path. Like -dst and -prefix, the
default package name can be inferred from the current directory,
but there is also a new -pkg option to override the default if needed.

I added a -o option to specify the destination output file (standard output
is still the default output). One benefit of -o is that it makes the bundle
commands self-contained in the sense of not needing a shell.
That in turn makes them suitable for use with "go generate", so when -o
is specified the bundle output now includes a "//go:generate" comment
for updating the bundle mechanically.

To keep bundle working for net/http's use case, I added a -importmap
option to specify additional import rewrites (net/http needs the http2
import of golang.org/x/net/http2/hpack rewritten to begin with internal/golang.org).

The net effect of all of this is that the first two lines at the top of
net/http/h2_bundle.go will change from:

	// Code generated by golang.org/x/tools/cmd/bundle command:
	//   $ bundle golang.org/x/net/http2 net/http http2

to

	// Code generated by golang.org/x/tools/cmd/bundle.
	//go:generate bundle -o h2_bundle.go -prefix http2 -import golang.org/x/net/http2/hpack=internal/golang.org/x/net/http2/hpack golang.org/x/net/http2

and net/http's copy of http2 can now be updated by "go generate"
instead of by copying and pasting commands from source code to shell.

For an experiment I am doing with cmd/dist bundling archive/zip,
the header is even shorter and makes a better demonstration of the
power of the defaults:

	// Code generated by golang.org/x/tools/cmd/bundle.
	//go:generate bundle -o zip.go archive/zip

New usage message, printed by "bundle -help" and "bundle":

	Usage: bundle [options] <src>
	  -dst path
	    	set destination import path (default taken from current directory)
	  -import map
	    	rewrite import using map, of form old=new (can be repeated)
	  -o file
	    	write output to file (default standard output)
	  -pkg name
	    	set destination package name (default taken from current directory)
	  -prefix p
	    	set bundled identifier prefix to p (default source package name + "_")

See CL for new doc comment.

Following this CL I will send a CL updating the two-line header in net/http/h2_bundle.go
to match the new usage of the bundle, whatever that ends up being.

Change-Id: I83a65b6a500897854027cefdefb8f62f1d4448b4
Reviewed-on: https://go-review.googlesource.com/19428
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-17 15:40:24 +00:00
Alan Donovan
cd3cb7be66 cmd/guru: fix build breakage due to unneeded log import
I think this resulted from git automerging.

Change-Id: Icc285601846bd0a2a2bb2316ae4575395744c44b
Reviewed-on: https://go-review.googlesource.com/19511
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-16 02:42:20 +00:00
Alan Donovan
fb3df4a89d cmd/guru: definition: try parser-based resolution first
The parser does intra-file resolution.  It's only a best-effort but
it's extremely fast, so we try it first and fall back to the loader-based
implementation if it fails.

Also:
- factor definitionResult so it doesn't depend on either go/types.Object
  or go/ast.Object.
- guessImportPath: make importPath=="" result an error,
  since you can't import the empty string.  Simplify importQueryPackage.
- Make fastQueryPos continue in face of minor parse errors.
- describe: eliminate old TODO; suppress log statement.

Change-Id: I30a32487e9fd9d5308b1580ec12220cad2c16299
Reviewed-on: https://go-review.googlesource.com/19507
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-02-16 00:29:23 +00:00
Alan Donovan
d7762ee5c0 cmd/guru: emacs: report an error when the guru command fails
Don't just display the output buffer or, worse, parse it as JSON.

Change-Id: I1125ff235a5073b07f45f587ef8844b8a12f05ac
Reviewed-on: https://go-review.googlesource.com/19508
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-15 21:39:43 +00:00
Alan Donovan
19c83edf02 cmd/guru: in Emacs, change 'definition' to jump directly
go-guru--run has been split up to separate running the tool
from turning its output into compilation-mode form.
The definition command uses only the first part,
and parses its output in JSON form.

Added test, factoring the test script.

Change-Id: I4c3e4a51a1346551a3703a5e3137c878d7b2d95f
Reviewed-on: https://go-review.googlesource.com/19499
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-15 17:57:16 +00:00
Alan Donovan
e08a7ae6bc cmd/guru: add support for loading modified files
The -modified flag causes guru to read a simple archive file from stdin.
This archive specifies alternative contents for one or more file names.
The build.Context checks this table before delegating to the usual
behavior.

This will not work for files that import "C" since cgo accesses the
file system directly.

Added end-to-end test via Emacs.

Simplify findQueryPos (now: fileOffsetToPos)

Credit: Daniel Morsing, for the prototype of this feature.

Change-Id: I5ae818ed5e8bb81001781893dded2d085e9cf8d6
Reviewed-on: https://go-review.googlesource.com/19498
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-02-15 15:04:13 +00:00
Alan Donovan
93ea01aea0 cmd/guru: describe: show methods and fields of an expression
Previously you had to describe a type to get this information,
which required two queries, and the need for this query is
extremely common.

Change-Id: I1d1d5b45fead60ca8719ddc302eee47d9f10a375
Reviewed-on: https://go-review.googlesource.com/19501
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-15 03:46:17 +00:00
Alan Donovan
608d57b3ae cmd/guru: call{ers,stack}: avoid pointer analysis where possible
As an optimization, the callers and callstack queries now avoid the
relatively costly pointer analysis in some common cases:

The callers of a function that is never address-taken can be enumerated
directly from the SSA representation.

Similarly, the callstack can be computed initially by ignoring dynamic
call edges; we run the pointer analysis only if no path is found in this
partial callgraph.  As a bonus, this also causes the tool to
preferentially report all-static callpaths.

A callers query on fmt.Errorf now completes in 3 seconds instead of 8,
and a callstack query completes in 2 seconds instead of 8.

The new code is covered by the existing tests.

Change-Id: I777ea07a1cdb6cadcc2a94952f553b6b036e7382
Reviewed-on: https://go-review.googlesource.com/19496
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-12 23:38:00 +00:00
Alan Donovan
8da9f8bbd7 cmd/guru: describe: show selectable fields when describing a type
Also, qualify field and method types relative to the defining package,
not the query package.

Change-Id: If65d2a4c2fd60e51d0d34e44000954e95106972e
Reviewed-on: https://go-review.googlesource.com/19495
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-12 23:35:49 +00:00
Alan Donovan
1d6b8698af cmd/guru: remove vestiges of -pos flag
It's a positional parameter now.

Also, update -help message to address
https://go-review.googlesource.com/#/c/19474 comments

Change-Id: Ie5947aa3c37180961e780747ca02be54f7030c21
Reviewed-on: https://go-review.googlesource.com/19493
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-12 22:00:14 +00:00
Alan Donovan
00b8b1eb95 cmd/guru: clean ups to command-line interface
-pos is now a positional argument; -scope is now a flag.
Tidy up usage message.
Update Vim and Emacs scripts and test
Remove call to GOMAXPROCS.
Use log.{SetPrefix,SetFlags} and Fatalf

Change-Id: I3786ed83aecb17d622b29d2a538a374f813f0adc
Reviewed-on: https://go-review.googlesource.com/19438
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-12 21:50:49 +00:00
Alan Donovan
789265387f cmd/guru: freevars: reenable test of labels (and improve output)
Change-Id: Icb7747d0856a4be2de52e143b793b52a725d297c
Reviewed-on: https://go-review.googlesource.com/19437
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-12 03:59:51 +00:00
Alan Donovan
37bb37ec1c cmd/guru: fix bad import, and run gofmt
Change-Id: Ieb5c732bad494942f7b45ac5a1b605e810436e87
Reviewed-on: https://go-review.googlesource.com/19478
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-12 03:58:01 +00:00
Alan Donovan
7347379304 cmd/guru: rename oracle to guru, copying it to a single package
See plans at:
https://docs.google.com/document/d/1UErU12vR7jTedYvKHVNRzGPmXqdMASZ6PfE7B-p6sIg/edit#heading=h.t5rbcuy7di7j

Change-Id: I369747e0ce8cd42a2975eb0f651a2e5fba47cf9e
Reviewed-on: https://go-review.googlesource.com/19475
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-12 03:38:58 +00:00
Alan Donovan
78e666a894 cmd/oracle: add pointsto, whicherrs to help message
Also, remove stale example.

Change-Id: Ifa1123b9dca49c991a16ef35eb7227847878c657
Reviewed-on: https://go-review.googlesource.com/19474
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-11 22:30:21 +00:00
Larz Conwell
9a6ae37d4e cmd/godoc: accept GOOS and GOARCH URL parameters in -http mode
This allows users to change the GOOS/GOARCH without running their own
godoc server (or restarting with appropriate env vars).

Change-Id: I0b54ef1b2dd93cf2c965ca584d8df74119ed1be6
Reviewed-on: https://go-review.googlesource.com/1371
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-02-04 22:11:53 +00:00
Brad Fitzpatrick
b47dfd93e5 all: fix plan9 failures
Updates golang/go#11811

Change-Id: I6ed252eb3272354fce8084ec99f4777e41c3daa3
Reviewed-on: https://go-review.googlesource.com/18993
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-01-28 00:31:03 +00:00
Chris Broadfoot
e7cdd7bb9f cmd/tip: update deploy instructions
Change-Id: I5c26a2fc8ef7c0ad99c3d176b866f221cb39c9e2
Reviewed-on: https://go-review.googlesource.com/18980
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-01-27 02:50:12 +00:00
Chris Broadfoot
ce967854d3 cmd/tip: move side health check to main health check. Use 503.
500 is considered to be healthy. Use 503 instead, so the instance is
considered unhealthy while the side is coming up.

Add some extra log statements that help debug instances from
application logs.

Fixes golang/go#13682.

Change-Id: I713c8c2fa75de4e275f632b999edc98cedd257bd
Reviewed-on: https://go-review.googlesource.com/18547
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-01-25 21:17:16 +00:00
Timothy Studd
b57d82def5 x/tools/present: add video element for slides
Change-Id: I19f7c181d9bd8148f7791925f04207a34c95ac1e
Reviewed-on: https://go-review.googlesource.com/18484
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-01-13 03:34:37 +00:00
Alan Donovan
f8ecfdb6b6 cmd/stringer: fork and tag for go1.4
The previous change updated the import of golang.org/x/tools/go/types
to the standard go/types package, causing 1.4 builds to fail.

Fixes #13874.

Change-Id: Idf0b4ac5e4e01dd5cd7cc9b89d017fbffb7a29df
Reviewed-on: https://go-review.googlesource.com/18430
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-11 14:24:22 +00:00
Alan Donovan
da91609d88 cmd/vet: roll back update of go/types import
(from importing golang.org/x/tools/go/types to std lib go/types)

The cmd/vet package should never have been included in this change.

Tested with 1.4.1, 1.5 and ~1.6 (tip).

Change-Id: I6d915619cbfa0297dbb9aa9ba033c1320a08c367
Reviewed-on: https://go-review.googlesource.com/18385
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-07 20:27:05 +00:00
Timothy Studd
1e63c6ac3b present: add background image element for slides
Fixes golang/go#11470

Change-Id: I665622197bea48b95adc839be8de7d03bf812f37
Reviewed-on: https://go-review.googlesource.com/18360
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-01-07 03:28:50 +00:00
Alan Donovan
542ffc7e75 tools: switch to standard go/types at tip
A few files have been forked and tagged "go1.5,!go1.6" to work around
minor API changes between the two types packages:
- constant.Value.String() in oracle/describe.go and its tests;
- constant.ToInt must now be called before constant.Int64Val.
- types.Config{Importer: importer.Default()} in a number of places
- go/types/typeutil/import_test.go uses lowercase names to avoid 'import "C"'.

Files in go/types/typesutil, missing from my previous CL, have been
tagged !go1.5; these files will be deleted in February.

All affected packages were tested using 1.4.1, 1.5, and ~1.6 (tip).

Change-Id: Iec7fd370e1434508149b378438fb37f65b8d2ba8
Reviewed-on: https://go-review.googlesource.com/18207
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-06 22:15:26 +00:00
Alan Donovan
2477c0d578 x/tools/...: fork and tag !1.5 all files that use go/types et al
This change will ensure that the tree continues to work with go1.4.1.

All files continue to depend on golang.org/x/tools/go/types, but in a
follow-up change, I will switch the primary files to depend on the
standard go/types package.  Another (smaller) set of files will be
forked and tagged, this time !1.6, due to API differences between the
two packages.

All tests pass using 1.4.1, 1.5, and ~1.6 (tip).

Change-Id: Ifd75a6330e120957d646be91693daaba1ce0e8c9
Reviewed-on: https://go-review.googlesource.com/18333
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-06 20:40:09 +00:00
Alan Donovan
108b52ee61 cmd/gorename: -d flag prints diffs instead of rewriting files
The user may specify the diff tool using the -diffcmd flag.

+ test.

Also:
- eliminate redundant DryRun flag
- simplify Verbose messages using log.SetPrefix

Fixes issue #13355

Change-Id: I917edc73e31ddf0f5d5b9b30c43f826465529da1
Reviewed-on: https://go-review.googlesource.com/18208
Reviewed-by: Michael Matloob <matloob@golang.org>
2015-12-30 15:25:00 +00:00
Alan Donovan
99c318c742 cmd/bundle: add blank line before package declaration
so that the bundled package doesn't clobber the package declaration
of the host package.

Also: minor comment tweaks.

Change-Id: I28ab3aca2b02213edc95c6b12c0d1a2514453cfe
Reviewed-on: https://go-review.googlesource.com/18040
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-18 13:56:53 +00:00
Chris Broadfoot
4a5fb9938b cmd/tip: add App Engine Managed VM health check handler
Change-Id: I67826efaa3cb2883771837581dd95aa9ec3e6d2b
Reviewed-on: https://go-review.googlesource.com/18025
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-18 02:25:12 +00:00
Alan Donovan
c0008c5889 x/tools/cmd/callgraph: add -ptalog flag
Since this tool is a handy way to run the pointer analysis during debugging.

Change-Id: If9a62f71dd8651ad6c782ead85bb84f09c703cba
Reviewed-on: https://go-review.googlesource.com/17382
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-12-04 17:49:28 +00:00
Andrew Gerrand
9cd799205e cmd/godoc: add redirect for x/term repo
Update golang/go#13104

Change-Id: I76102038d8dc87503c9a8994f9008b1a9fdb19d4
Reviewed-on: https://go-review.googlesource.com/17020
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-11-18 05:08:28 +00:00
Tamir Duberstein
4b07c5ce8a cmd/stringer: prepend "Code" to codegen warning
This allows Github to hide diffs in generated files. See:
https://github.com/github/linguist/blob/473282d/lib/linguist/generated.rb#L241

Change-Id: Ic0a9ed80ecc6130d81fd0ba10e2df48217eb14cc
Reviewed-on: https://go-review.googlesource.com/15073
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-11-08 08:43:00 +00:00
Andrew Gerrand
dec63b8e98 cmd/godoc: add x/time and x/sync redirects
Fixes golang/go#13133

Change-Id: I45031352d4d7c040889134310ad5721dd9dcc1ee
Reviewed-on: https://go-review.googlesource.com/16640
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-04 02:28:00 +00:00
Alan Donovan
199b70b426 x/tools/cmd/bundle: a tool to concatenate source files, preserving reference integrity
+ Test.

For background, see "http -> http2 -> http import cycle" thread on golang-dev.

Change-Id: Idc422247e5935ef7615cd5e8b7e2c489f7f2bc31
Reviewed-on: https://go-review.googlesource.com/15850
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-10-29 19:10:01 +00:00
Tw
6a71ab8780 cmd/present: only include play.js in article when necessary
There is no need to add play.js in article page when
playground is disabled.

Signed-off-by: Tw <tw19881113@gmail.com>

Change-Id: If40d256c89d7bd37efff9e08bb176bd3ea2d6f88
Reviewed-on: https://go-review.googlesource.com/16415
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-10-29 04:57:28 +00:00
David du Colombier
81e6679d08 x/tools/cmd/stress: build on Plan 9
Fixes golang/go#11975.

Change-Id: Icfbf3015031824481b351ac78be5917ee5d20e8e
Reviewed-on: https://go-review.googlesource.com/16306
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David du Colombier <0intro@gmail.com>
2015-10-26 22:13:12 +00:00