1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:54:42 -07:00
The Go programming language
Go to file
Alan Donovan d2cdbefbfc go.tools/oracle: add option to output results in JSON syntax.
See json.go for interface specification.

Example usage:
% oracle -format=json -mode=callgraph code.google.com/p/go.tools/cmd/oracle

+ Tests, based on (small) golden files.

Overview:
  Each <query>Result structure has been "lowered" so that all
  but the most trivial logic in each display() function has
  been moved to the main query.

  Each one now has a toJSON method that populates a json.Result
  struct.  Though the <query>Result structs are similar to the
  correponding JSON protocol, they're not close enough to be
  used directly; for example, the former contain richer
  semantic entities (token.Pos, ast.Expr, ssa.Value,
  pointer.Pointer, etc) whereas JSON contains only their
  printed forms using Go basic types.

  The choices of what levels of abstractions the two sets of
  structs should have is somewhat arbitrary.  We may want
  richer information in the JSON output in future.

Details:
- oracle.Main has been split into oracle.Query() and the
  printing of the oracle.Result.
- the display() method no longer needs an *oracle param, only
  a print function.
- callees: sort the result for determinism.
- callees: compute the union across all contexts.
- callers: sort the results for determinism.
- describe(package): fixed a bug in the predicate for method
  accessibility: an unexported method defined in pkg A may
  belong to a type defined in package B (via
  embedding/promotion) and may thus be accessible to A.  New
  accessibleMethods() utility fixes this.
- describe(type): filter methods by accessibility.
- added tests of 'callgraph'.
- pointer: eliminated the 'caller CallGraphNode' parameter from
  pointer.Context.Call callback since it was redundant w.r.t
  site.Caller().
- added warning if CGO_ENABLED is unset.

R=crawshaw
CC=golang-dev
https://golang.org/cl/13270045
2013-09-03 15:29:02 -04:00
cmd go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
dashboard go.tools/dashboard: implement dashboard using vcs package. 2013-08-27 21:52:18 -07:00
go go.tools/go/vcs: use same regular expression for code.google.com as cmd/go 2013-08-29 14:32:06 +10:00
godoc go.tools/cmd/godoc: don't list factory functions under types in builtin package 2013-08-28 09:39:02 +10:00
gotype go.tools/gotype: fix build 2013-07-19 07:52:43 -07:00
importer go.tools: add copyright messages to source files. 2013-08-27 18:49:13 -04:00
oracle go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
pointer go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
ssa go.tools/cmd/ssadump: move ssa/ssadump.go command to its own package. 2013-08-29 21:34:36 -04:00
.hgignore go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
codereview.cfg go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:58 +11:00
PATENTS go.empty: add PATENTS file to the subrepo. 2012-04-16 11:24:04 +10:00
README go.tools: provide the right README 2013-05-17 12:55:10 -07:00

This subrepository holds the source for various packages and tools that support
the Go programming language.

Although at least some of the tools themselves will be included in binary Go distributions,
the packages from which they are built are of little interest to most Go programmers.

To submit changes to this repository, see http://golang.org/doc/contribute.html.