1
0
mirror of https://github.com/golang/go synced 2024-10-01 09:28:37 -06:00
go/cmd/oracle
Alan Donovan e8afbfad8c go.tools/importer: API rethink.
The Importer type has been replaced with Config and Program.

Clients populate a Config, directly or more usually via
convenience functions.  They then call its Load() method to do
all of the typechecking and transitive-closure computation.

ssa.NewProgram and ssa.CreatePackages have been fused into
ssa.Create, which now cannot fail, since (*Config).Load()
reports all type errors.

Also:
- The addition of an ssa.GlobalDebug builder mode flag
  eliminates a loop-over-packages repeated in many clients.
- PackageInfo.Err flag unexported.  Clients never see bad infos now.
- cmd/ssadump: now only looks for func "main" in package "main".
- importsOf deleted, was dead code.

STILL TODO:
- ParseFile seems like API creep (though it's convenient)
  and CreateFromFiles is dangerous (w.r.t. FileSet identity).
  Need to think more...
- the need for clients to rely on elementwise correspondence
  of Config.CreatePkgs and Program.Created is a little sad.
- The command-line interface has not changed.
  That will happen in a follow-up.
  r recommends using a repeated flag: -package p -package q ...

R=gri
CC=axwalk, frederik.zipp, golang-codereviews
https://golang.org/cl/49530047
2014-01-15 21:37:55 -05:00
..
emacs-test.bash go.tools/oracle: change -mode argument into subcommand. 2013-09-25 14:34:39 -04:00
main.go go.tools/importer: API rethink. 2014-01-15 21:37:55 -05:00
oracle.el go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
oracle.vim go.tools/oracle: change -mode argument into subcommand. 2013-09-25 14:34:39 -04:00