Documentation
¶
Index ¶
- func InitPkgFlag(pkg *Package)
- type Decl
- type DeclKind
- type Field
- type Fields
- type File
- type FuncDecl
- type FuncInfo
- type InterfaceType
- type Package
- type Packages
- func (c *Packages) Add(packages *load.Packages)
- func (p *Packages) CloneWithPackages(packages []*Package) *Packages
- func (p *Packages) Filter(f func(pkg *Package) bool) []*Package
- func (c *Packages) LoadPackage(pkgPath string) (*Package, bool, error)
- func (c *Packages) LoadPackages(pkgPaths []string) error
- func (c *Packages) Merge(pkgs *Packages, override bool)
- type VarInfo
- type VarRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitPkgFlag ¶ added in v1.1.1
func InitPkgFlag(pkg *Package)
Types ¶
type Decl ¶
type Decl struct {
Kind DeclKind
Ident *ast.Ident
Type ast.Expr // might be nil
Value ast.Expr // only for var, might be nil
ResolvedValueType types.Type
Decl *ast.GenDecl
// Pending var refs for rewrite
// for var only
VarRefs []*VarRef
// for Func
FuncDecl *FuncDecl
// for Type
Methods map[string]*FuncDecl
File *File
}
type File ¶
type InterfaceType ¶
type Package ¶
type Package struct {
LoadPackage *load.Package
Files []*File
Decls map[string]*Decl
Collected bool
// Main indicates the package is
// within the main module
// NOTE: this does not consider go.mod
// boundaries, it only consider the
// prefix of the package path.
Main bool
// Initial indicates whether
// the packages are loaded via
// package args specified by user
Initial bool
// Xgo indicates whether
// the package is xgo/runtime
Xgo bool
// AllowInstrument indicates whether
// the package is allowed to be instrumented
AllowInstrument bool
}
type Packages ¶
type Packages struct {
Fset *token.FileSet
Packages []*Package
PackageByPath map[string]*Package
LoadOptions load.LoadOptions
}
func (*Packages) CloneWithPackages ¶ added in v1.1.1
func (*Packages) LoadPackage ¶ added in v1.1.1
func (*Packages) LoadPackages ¶ added in v1.1.1
type VarRef ¶ added in v1.1.1
type VarRef struct {
File *File
// the prefiex & token, if any
Addr *ast.UnaryExpr
// call get() or get_addr()
NeedPtr bool
NameStart token.Pos
// the end position of the name
NameEnd token.Pos
// FieldAccess indicates this is &variable.Field pattern
// In this case, keep the & and use _xgo_get() instead of _xgo_get_addr()
FieldAccess bool
}
Click to show internal directories.
Click to hide internal directories.