pkgutil

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalPkgs map[*ssa.Package]bool

Functions

func AllPackages

func AllPackages(prog *ssa.Program) []*ssa.Package

func CheckInGoroot

func CheckInGoroot(fun *ssa.Function) bool

Returns true iff. the function is in a package in the GOROOT.

func CheckPkgInGoroot

func CheckPkgInGoroot(pkg *types.Package) bool

func CreateFakeTestMainPackage

func CreateFakeTestMainPackage(testFun *ssa.Function) *ssa.Package

Creates a fake main package that calls the supplied test function.

func GetLocalPackages

func GetLocalPackages(mains []*ssa.Package, pkgs []*ssa.Package) (err error)

* GetLocalPackages

func GetMain

func GetMain(mains []*ssa.Package) (main *ssa.Package)

Determine what is the main package as follows: 1. Take the package with the most members 2. Skip the package suffixed with .test

func IsLocal

func IsLocal(val ssa.Value) bool

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

func LoadPackagesFromSource(source string) ([]*packages.Package, error)

Mainly useful for testing

func LoadPackagesWithConfig

func LoadPackagesWithConfig(config *packages.Config, query string) ([]*packages.Package, error)

func TestFunctions

func TestFunctions(prog *ssa.Program) (res []*ssa.Function)

Types

type LoadConfig

type LoadConfig struct {
	GoPath, ModulePath string
	IncludeTests       bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL