inspector

package
v0.0.0-...-dcec06b Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inspector

type Inspector struct {
	// contains filtered or unexported fields
}

func NewInspector

func NewInspector(path string, tests bool) (*Inspector, error)

NewInspector will find all .go files rooted at the given path and load them into the returned Inspector

func (*Inspector) FileName

func (ins *Inspector) FileName(pos token.Pos) string

func (*Inspector) PackageName

func (ins *Inspector) PackageName(pos token.Pos) string

func (*Inspector) WalkAST

func (ins *Inspector) WalkAST(types []ast.Node, fn func(n ast.Node))

Walks the inspectors ast.Nodes in depth first order executing the provided fn before visiting children.

func (*Inspector) WalkASTWithStack

func (ins *Inspector) WalkASTWithStack(types []ast.Node, fn func(n ast.Node, push bool, stack []ast.Node) (proceed bool))

func (*Inspector) WalkPackages

func (ins *Inspector) WalkPackages(fn func(pkg *packages.Package))

Iterates over all Go packages in the order returned by golang.org/x/tools/go/packages.Load and calls the provided function with that package as an input.

Jump to

Keyboard shortcuts

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