1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:18:32 -06:00
go/cmd
Alan Donovan 2da0720e4f cmd/guru: support streaming plain and -json output
Visible changes:
- "referrers" queries now emit a stream of results,
  so they start appearing quickly even in large queries.
  We no longer report the total number of matches.
- packageReferrers now also uses AfterTypeCheck hook and streaming.
- XML support has been dropped.
- The -format flag has been replaced by -json.

JSON protocol changes:
- The enclosing Result struct has been removed.
- Likewise the 'mode' field (since the caller knows it already)
- "freevars" and "referrers" now emit a stream of objects
  In the case of referrers, the first object has a different from the rest.
- The "referrers" results include the text of the matching line
  (parity with -json=false)

Implementation details:
- the concurrency-safe q.Output function can be called
  many times, each with a queryResult to print.
- fset is no longer saved in Query (cleaner)
- queryResult methods renamed PrintPlain, JSON

Change-Id: I41a4e3f57f266fcf043ece4045bca82c6f6a356f
Reviewed-on: https://go-review.googlesource.com/21397
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-04-11 19:51:55 +00:00
..
benchcmp benchmark/parser, cmd/benchcmp: improve names of exported identifiers 2015-01-15 01:28:17 +00:00
bundle all: address vet issues, fix print calls 2016-03-27 20:36:34 +00:00
callgraph x/tools/cmd/callgraph: add -ptalog flag 2015-12-04 17:49:28 +00:00
cover all: address vet issues, fix print calls 2016-03-27 20:36:34 +00:00
digraph tools: add import comments. 2014-12-09 22:42:16 +00:00
eg refactor/eg: refactor to break dependency on go/loader 2015-09-01 14:26:06 +00:00
fiximports cmd/fiximports: -replace flag specifies canonical packages in absence of import comments 2015-09-01 14:23:39 +00:00
godex x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
godoc cmd/godoc: accept GOOS and GOARCH URL parameters in -http mode 2016-02-04 22:11:53 +00:00
goimports imports: add support for vendor directories 2016-02-18 16:47:46 +00:00
gomvpkg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gorename cmd/gorename: -d flag prints diffs instead of rewriting files 2015-12-30 15:25:00 +00:00
gotype x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
guru cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
html2article all: address vet reports 2014-12-29 06:08:34 +00:00
oracle cmd/oracle: add pointsto, whicherrs to help message 2016-02-11 22:30:21 +00:00
present x/tools/present: add command line flag to enable presenter notes 2016-04-07 00:38:29 +00:00
ssadump x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
stress all: fix plan9 failures 2016-01-28 00:31:03 +00:00
stringer x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
tip cmd/tip: use manual scaling for tip.golang.org 2016-04-06 00:03:48 +00:00