loaderx

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommentsOf

func CommentsOf(fileSet *token.FileSet, targetNode ast.Node, files ...*ast.File) string

func FileOf

func FileOf(targetNode ast.Node, files ...*ast.File) *ast.File

func ForEachFuncResult

func ForEachFuncResult(program *loader.Program, typeFunc *types.Func, walker func(resultTypeAndValues ...types.TypeAndValue))

func FuncDeclOf

func FuncDeclOf(ident *ast.Ident, file *ast.File) (funcDecl *ast.FuncDecl)

func FuncDeclOfTypeFunc

func FuncDeclOfTypeFunc(pkgInfo *loader.PackageInfo, typeFunc *types.Func) *ast.FuncDecl

func GetIdentChainCallOfCallFun

func GetIdentChainCallOfCallFun(expr ast.Expr) (list []*ast.Ident)

func GetPkgImportPathAndExpose

func GetPkgImportPathAndExpose(s string) (pkgImportPath string, expose string)

func IndirectType

func IndirectType(tpe types.Type) types.Type

func MethodOf

func MethodOf(named *types.Named, funcName string) (typeFunc *types.Func)

func MustEvalExpr

func MustEvalExpr(fileSet *token.FileSet, pkg *types.Package, expr ast.Expr) types.TypeAndValue

func NewTestProgram

func NewTestProgram(content string) (pkgImportPath string, program *loader.Program)

func ResolvePkgImport

func ResolvePkgImport(pkgImportPath string) string

func StringifyAst

func StringifyAst(fset *token.FileSet, node ast.Node) string

func StringifyCommentGroup

func StringifyCommentGroup(commentGroupList ...*ast.CommentGroup) (comments string)

Types

type ByCommentPos

type ByCommentPos []*ast.CommentGroup

func (ByCommentPos) Len

func (a ByCommentPos) Len() int

func (ByCommentPos) Less

func (a ByCommentPos) Less(i, j int) bool

func (ByCommentPos) Swap

func (a ByCommentPos) Swap(i, j int)

type CommentScanner

type CommentScanner struct {
	CommentMap ast.CommentMap
	// contains filtered or unexported fields
}

func NewCommentScanner

func NewCommentScanner(fileSet *token.FileSet, file *ast.File) *CommentScanner

func (*CommentScanner) CommentGroupListOf

func (scanner *CommentScanner) CommentGroupListOf(targetNode ast.Node) (commentGroupList []*ast.CommentGroup)

func (*CommentScanner) CommentsOf

func (scanner *CommentScanner) CommentsOf(targetNode ast.Node) string

type Query

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

func NewQuery

func NewQuery(program *loader.Program, pkgImportPath string) *Query

func (*Query) Const

func (q *Query) Const(name string) *types.Const

func (*Query) Func

func (q *Query) Func(name string) *types.Func

func (*Query) TypeName

func (q *Query) TypeName(name string) *types.TypeName

func (*Query) Var

func (q *Query) Var(name string) *types.Var

Directories

Path Synopsis
package
package

Jump to

Keyboard shortcuts

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