Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentPackageName ¶
func CurrentPackageName() string
CurrentPackageName returns the package name at the calling site Uses runtime stack inspection to skip one frame and locate the calling source file Then parses the package declaration to extract the package name
CurrentPackageName 返回调用者位置的包名 使用运行时栈检查跳过一层来定位调用源文件 然后解析包声明以提取包名
func GetPkgName ¶
GetPkgName returns the package name from a Go source file path Parses the package declaration at the beginning of the file to extract the name Works with any valid Go source file containing a package statement
GetPkgName 从 Go 源文件路径返回包名 解析文件开头的包声明来提取名称 适用于任何包含 package 语句的有效 Go 源文件
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
demos/demo1x
command
Demo1x shows basic AST parsing and manipulation Parse Go source file into AST and extract package info Print AST structure for inspection and debugging
|
Demo1x shows basic AST parsing and manipulation Parse Go source file into AST and extract package info Print AST structure for inspection and debugging |
|
demos/demo2x
command
Demo2x shows type reflection and package path extraction Extract package info from Go types using reflection Generate qualified type names for code generation
|
Demo2x shows type reflection and package path extraction Extract package info from Go types using reflection Generate qualified type names for code generation |
|
demos/demo3x
command
Demo3x shows AST search and code element finding Search functions and types in parsed AST Navigate struct fields and extract declarations
|
Demo3x shows AST search and code element finding Search functions and types in parsed AST Navigate struct fields and extract declarations |
|
demos/demo4x
command
Demo4x shows struct tag parsing and field extraction Parse GORM and JSON tags from struct field tags Extract specific fields and values from tag strings
|
Demo4x shows struct tag parsing and field extraction Parse GORM and JSON tags from struct field tags Extract specific fields and values from tag strings |
|
utils
Package utils provides internal helper functions for syntaxgo These utilities serve the main syntaxgo package and are not exported Functions here handle common operations like string manipulation and file checks
|
Package utils provides internal helper functions for syntaxgo These utilities serve the main syntaxgo package and are not exported Functions here handle common operations like string manipulation and file checks |
|
Package syntaxgo_astnode provides utilities to work with AST nodes Handle node position info and extract code content from AST nodes Support operations like code extraction, modification, and deletion
|
Package syntaxgo_astnode provides utilities to work with AST nodes Handle node position info and extract code content from AST nodes Support operations like code extraction, modification, and deletion |
|
Package syntaxgo_astnorm provides function signature processing utilities Extract and process function params and return values from AST Generate code for function calls, variable definitions, and type conversions
|
Package syntaxgo_astnorm provides function signature processing utilities Extract and process function params and return values from AST Generate code for function calls, variable definitions, and type conversions |
|
Package syntaxgo_reflect provides type reflection and package path extraction Extract package info from Go types using reflection API Generate qualified type names and import statements to use in code generation
|
Package syntaxgo_reflect provides type reflection and package path extraction Extract package info from Go types using reflection API Generate qualified type names and import statements to use in code generation |
|
Package syntaxgo_tag provides struct tag parsing and manipulation utilities Parse GORM, JSON, and other tags from struct field tag strings Extract specific fields and values, update tag contents programmatically
|
Package syntaxgo_tag provides struct tag parsing and manipulation utilities Parse GORM, JSON, and other tags from struct field tag strings Extract specific fields and values, update tag contents programmatically |
Click to show internal directories.
Click to hide internal directories.