Documentation ¶
Index ¶
- Variables
- func DisableLog()
- func EnableLog()
- func ExprString(expr ast.Expr) (name string)
- func Find(parent ast.Node, queries []interface{}) (children []ast.Node, err error)
- func Name(node ast.Node) string
- func ReadPackage(pkgPath string) (pkg *ast.Package, err error)
- func ReadPackageWithName(pkgPath string, pkgName string, fileScope string, ...) (pkg *ast.Package, err error)
- func SetLogOutput(writer io.Writer)
- func SrcOf(node ast.Node) string
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 开了缓存,ops 可以提高三个数量级 OptPackageCache = true )
View Source
var (
OptReturnOnError = true
)
Functions ¶
func DisableLog ¶ added in v0.5.7
func DisableLog()
func ExprString ¶
ExprString generates code by ast.Expr like printer.Fprint() 经过拼装,可能与源码不完全一致 TODO 2019.9.28 最开始不知道有 printer 这个包,手写了一坨,后面可能会直接接过去。。 Deprecated
func ReadPackage ¶ added in v0.5.6
ReadPackage is simple wrapper for parserDir use pkgName with last segment in pkgPath
func ReadPackageWithName ¶ added in v0.5.6
func ReadPackageWithName(pkgPath string, pkgName string, fileScope string, filter func(os.FileInfo) bool) (pkg *ast.Package, err error)
ReadPackageWithName read package with specified package name fileScope used for cache key
func SetLogOutput ¶ added in v0.5.7
Types ¶
Click to show internal directories.
Click to hide internal directories.