|
||
---|---|---|
.. | ||
README.md | ||
comment.go | ||
field.go | ||
file.go | ||
function.go | ||
name.go | ||
package.go | ||
package_test.go | ||
struct.go | ||
type.go |
README.md
Astgo
暂无介绍...
目录导航
列出了该 package
下所有的函数及类型定义,可通过目录导航进行快捷跳转 ❤️
展开 / 折叠目录导航
包级函数定义
函数名称 | 描述 |
---|---|
NewPackage | 暂无描述... |
类型定义
类型 | 名称 | 描述 |
---|---|---|
STRUCT |
Comment | 暂无描述... |
STRUCT |
Field | 暂无描述... |
STRUCT |
File | 暂无描述... |
STRUCT |
Function | 暂无描述... |
STRUCT |
Package | 暂无描述... |
STRUCT |
Struct | 暂无描述... |
STRUCT |
Type | 暂无描述... |
详情信息
func NewPackage(dir string) (*Package, error)
查看 / 收起单元测试
func TestNewPackage(t *testing.T) {
p, err := astgo.NewPackage(`/Users/kercylan/Coding.localized/Go/minotaur/server`)
if err != nil {
panic(err)
}
fmt.Println(string(super.MarshalIndentJSON(p, "", " ")))
}
Comment STRUCT
type Comment struct {
Comments []string
Clear []string
}
Field STRUCT
type Field struct {
Anonymous bool
Name string
Type *Type
Comments *Comment
}
File STRUCT
type File struct {
af *ast.File
owner *Package
FilePath string
Structs []*Struct
Functions []*Function
Comment *Comment
}
func (*File) Package() string
Function STRUCT
type Function struct {
decl *ast.FuncDecl
Name string
Internal bool
Generic []*Field
Params []*Field
Results []*Field
Comments *Comment
Struct *Field
IsExample bool
IsTest bool
IsBenchmark bool
Test bool
}
func (*Function) Code() string
Package STRUCT
type Package struct {
Dir string
Name string
Dirs []string
Files []*File
Functions map[string]*Function
}
func (*Package) StructFunc(name string) []*Function
func (*Package) PackageFunc() []*Function
func (*Package) Structs() []*Struct
func (*Package) FileComments() *Comment
func (*Package) GetUnitTest(f *Function) *Function
func (*Package) GetExampleTest(f *Function) *Function
func (*Package) GetBenchmarkTest(f *Function) *Function
Struct STRUCT
type Struct struct {
Name string
Internal bool
Interface bool
Comments *Comment
Generic []*Field
Fields []*Field
Type *Type
Test bool
}
Type STRUCT
type Type struct {
expr ast.Expr
Sign string
IsPointer bool
Name string
}