Documentation ¶
Index ¶
- Variables
- func AllPackages(prog *ssa.Program) []*ssa.Package
- func CheckInGoroot(fun *ssa.Function) bool
- func CheckPkgInGoroot(pkg *types.Package) bool
- func CreateFakeTestMainPackage(testFun *ssa.Function) *ssa.Package
- func GetLocalPackages(mains []*ssa.Package, pkgs []*ssa.Package) (err error)
- func GetMain(mains []*ssa.Package) (main *ssa.Package)
- func IsLocal(val ssa.Value) bool
- func LoadPackages(cfg LoadConfig, packageName string) ([]*packages.Package, error)
- func LoadPackagesFromSource(source string) ([]*packages.Package, error)
- func LoadPackagesWithConfig(config *packages.Config, query string) ([]*packages.Package, error)
- func TestFunctions(prog *ssa.Program) (res []*ssa.Function)
- type LoadConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var LocalPkgs map[*ssa.Package]bool
Functions ¶
func CheckInGoroot ¶
Returns true iff. the function is in a package in the GOROOT.
func CheckPkgInGoroot ¶
func CreateFakeTestMainPackage ¶
Creates a fake main package that calls the supplied test function.
func GetLocalPackages ¶
* GetLocalPackages
func GetMain ¶
Determine what is the main package as follows: 1. Take the package with the most members 2. Skip the package suffixed with .test
func LoadPackages ¶
func LoadPackages(cfg LoadConfig, packageName string) ([]*packages.Package, error)
Load the AST for the packages matching the specified package name according to the provided LoadConfig.
func LoadPackagesFromSource ¶
Mainly useful for testing
func LoadPackagesWithConfig ¶
Types ¶
type LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.