Skip to content

pytimer/astutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

astutil

Go ast util generate AST by parsing all go file of the project

Usage

package main import (	goparser "go/parser" "log" "github.com/pytimer/astutil" ) func main() { pkgs := astutil.ParseDir("./testdata", []string{"vendor"}, goparser.ParseComments) for k, pkg := range pkgs { log.Printf("package path: %s, name: %s\n", k, pkg.Name) for _, f := range pkg.Files { log.Printf("astFile path: %s package: %s\n", f.Path, f.PackagePath) // log.Println(f.File) log.Printf("comments: %#v", f.Comments)	}	} }

About

Go ast util

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages