Skip to content
/ go-ast Public

A simpler and easier to understand ast toolset

Notifications You must be signed in to change notification settings

cxiaoji/go-ast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ast

A simpler and easier to understand ast toolset

What is Go-Ast?

Ast is commonly used for project code generation, but its syntax is very difficult to understand, so we have written a more understandable and easy-to-use ast toolset

Install

go get github.com/cxiaoji/go-ast

Examples

import "fmt"

func main() {
	var filePath = "./test/person.go"
	h := NewAstHelper(filePath)
	fileDesc ,err:= h.GetFileDesc()
	if err != nil {
		return
	}
	fmt.Println(fileDesc.Package) // package name
	fmt.Println(fileDesc.StructDescs) // all struct 
}

About

A simpler and easier to understand ast toolset

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages