myast

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImportFile

func AddImportFile(k, v string)

AddImportFile 添加自定义import文件列表

func AnalysisImport

func AnalysisImport(astPkgs *ast.Package) map[string]string

AnalysisImport 分析整合import相关信息

func AnalysisImportByFileID

func AnalysisImportByFileID(astPkgs *ast.Package, fileID string) map[string]string

AnalysisImportByFileID 分析整合import相关信息

func EvalSymlinks(modPkg, modFile, objPkg string) string

EvalSymlinks Return to relative path . 通过module 游标返回包相对路径

func GetAstPkgs

func GetAstPkgs(objPkg, objFile string) (*ast.Package, bool)

Re GetAstPkgs Parsing source file ast structure (with main restriction).解析源文件ast结构(带 main 限制)

func GetImportPkg

func GetImportPkg(i string) string

GetImportPkg 分析得出 pkg

func GetModuleInfo

func GetModuleInfo(n int) (string, string, bool)

GetModuleInfo find and get module info , return module [ name ,path ] 通过model信息获取[model name] [和 根目录绝对地址]

func GetObjFunMp

func GetObjFunMp(astPkg *ast.Package, objName string) map[string]ObjFunInfo

GetObjFunMp find all exported func of sturct objName GetObjFunMp 类中的所有导出函数

func NewStructAnalys

func NewStructAnalys(modPkg, modFile string) *structAnalys

NewStructAnalys 新建一个导出结构体类

Types

type ObjFunInfo

type ObjFunInfo struct {
	AstFunc *ast.FuncDecl
	Imports map[string]string
}

Jump to

Keyboard shortcuts

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