Documentation ¶
Overview ¶
Package importer provides implementation of go/type/importer.
It provides an ability to collect information, such as types, definitions, usages about the package and all inner packages.
The main method is Collect. It will analyze package and return pointer to package and file set. Also, CollectInfoImporter.Info structure will bee filled. For example,
info := types.Info{ Types: make(map[ast.Expr]types.TypeAndValue), Defs: make(map[*ast.Ident]types.Object), Uses: make(map[*ast.Ident]types.Object), } importer := new(CollectInfoImporter) importer.Pkg = pkg + "/testfunc/main" importer.Info = &info resultPkg, fset, err := importer.Collect()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectInfoImporter ¶
type CollectInfoImporter struct { //Info struct that will be filled by Collect() method Info *types.Info //Package that should be a start point to collect info Pkg string // contains filtered or unexported fields }
CollectInfoImporter importing packages with dependencies and collecting information to info field. You need to provide Pkg and Info prior to use it
Click to show internal directories.
Click to hide internal directories.