Documentation ¶
Index ¶
- Constants
- func FindPkgInfoByPath(path string, modes ...packages.LoadMode) (*packages.Package, error)
- func Import(path string) string
- func ImportPathAndExpose(s string) (string, string)
- func IsBlockContainsReturn(n ast.Node) (ok bool)
- func PkgIdByPath(path string, modes ...packages.LoadMode) (string, error)
- func PkgPathByPath(path string, modes ...packages.LoadMode) (string, error)
- func StringifyCommentGroup(cgs ...*ast.CommentGroup) string
- func StringifyNode(fs *token.FileSet, n ast.Node) string
- type CommentScanner
- type End
- type Pkg
- func (p *Pkg) AppendResult(res Results, i int, tve TypeAndValueExpr)
- func (p *Pkg) AssignedValueOf(ident *ast.Ident, pos token.Pos) []TypeAndValueExpr
- func (p *Pkg) CommentsOf(n ast.Node) string
- func (p *Pkg) Const(name string) *types.Const
- func (p *Pkg) Eval(expr ast.Expr) (types.TypeAndValue, error)
- func (p *Pkg) FileOf(n Pos) *ast.File
- func (p *Pkg) Func(name string) *types.Func
- func (p *Pkg) FuncDeclOf(fn *types.Func) (decl *ast.FuncDecl)
- func (p *Pkg) FuncResultsOf(fn *types.Func) (Results, int)
- func (p *Pkg) FuncResultsOfSignature(sig *types.Signature, body *ast.BlockStmt, ft *ast.FuncType) (Results, int)
- func (p *Pkg) IdentOf(obj types.Object) *ast.Ident
- func (p *Pkg) Imports() []*Package
- func (p *Pkg) PkgByPath(path string) *Package
- func (p *Pkg) PkgByPos(n Pos) *Package
- func (p *Pkg) PkgInfoOf(n Pos) *types.Info
- func (p *Pkg) PkgOf(n Pos) *types.Package
- func (p *Pkg) ResultsOf(callee *ast.CallExpr) Results
- func (p *Pkg) SetResultsByExpr(res Results, rhs ...ast.Expr)
- func (p *Pkg) TypeName(name string) *types.TypeName
- func (p *Pkg) Var(name string) *types.Var
- type Pos
- type Results
- type Set
- type TypeAndValueExpr
Constants ¶
View Source
const (
ModeLoadFiles = packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles
)
Variables ¶
This section is empty.
Functions ¶
func FindPkgInfoByPath ¶
func ImportPathAndExpose ¶
func IsBlockContainsReturn ¶
func StringifyCommentGroup ¶
func StringifyCommentGroup(cgs ...*ast.CommentGroup) string
Types ¶
type CommentScanner ¶
type CommentScanner struct { *ast.File ast.CommentMap }
func NewCommentScanner ¶
func NewCommentScanner(fs *token.FileSet, f *ast.File) *CommentScanner
func (*CommentScanner) CommentGroupsOf ¶
func (c *CommentScanner) CommentGroupsOf(n ast.Node) (cgs []*ast.CommentGroup)
func (*CommentScanner) CommentsOf ¶
func (c *CommentScanner) CommentsOf(n ast.Node) string
type Pkg ¶
type Pkg struct { *Package // contains filtered or unexported fields }
func (*Pkg) AppendResult ¶
func (p *Pkg) AppendResult(res Results, i int, tve TypeAndValueExpr)
func (*Pkg) AssignedValueOf ¶
func (*Pkg) FuncResultsOfSignature ¶
type Results ¶
type Results map[int][]TypeAndValueExpr
type Set ¶
type Set map[string]*Package
Set package set, mapping imported package id and package info
type TypeAndValueExpr ¶
type TypeAndValueExpr struct { ast.Expr types.TypeAndValue }
Click to show internal directories.
Click to hide internal directories.