Documentation
¶
Index ¶
- func CollectDecls(pkg *edit.Package)
- func Traverse(registry PackageRegistry, packages []*edit.Package, recorder *Recorder) error
- type Define
- type FileScope
- type GlobalScope
- type Imports
- type NameRecorder
- type PackageRegistry
- type PackageScope
- type PkgName
- type PkgRecorder
- type PkgScopeNames
- type Recorder
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectDecls ¶
Types ¶
type GlobalScope ¶
type NameRecorder ¶
func (*NameRecorder) AddMockName ¶
func (c *NameRecorder) AddMockName(name string)
type PackageRegistry ¶
type PackageRegistry interface {
Fset() *token.FileSet
LoadPackage(pkgPath string) (*edit.Package, bool, error)
GetPackage(pkgPath string) *edit.Package
}
func NewPackagesRegistry ¶
func NewPackagesRegistry(packages *edit.Packages) PackageRegistry
type PackageScope ¶
type PackageScope struct {
Package *edit.Package
Decls PkgScopeNames
}
func (PackageScope) PkgPath ¶
func (c PackageScope) PkgPath() string
type PkgRecorder ¶
type PkgRecorder struct {
Names map[string]*NameRecorder
// Names count of vars
NumVars int
}
func (*PkgRecorder) Get ¶
func (c *PkgRecorder) Get(name string) *NameRecorder
func (*PkgRecorder) GetOrInit ¶
func (c *PkgRecorder) GetOrInit(name string) *NameRecorder
type PkgScopeNames ¶
imports: key is local name, value is import path
type Recorder ¶
type Recorder struct {
// has called `trap.AddInterceptor`?
// if so, we need to enable trapAll mode
// as mentioned in https://github.com/xhd2015/xgo/issues/308#issuecomment-2800327536
HasTrapInterceptorRef bool
Pkgs map[string]*PkgRecorder
}
func (*Recorder) GetOrInit ¶
func (c *Recorder) GetOrInit(pkgPath string) *PkgRecorder
Source Files
¶
Click to show internal directories.
Click to hide internal directories.