func Walk(var node ast.Node) {
switch {
case astp.IsValueSpec(node):
value := astp.AsValueSpec()
for _, name := range value.Names {
if name != nil {
println("value name: " + name.Name)
}
}
case astp.IsFuncDecl(node):
fn := astp.AsFuncDecl()
if fn.Name != nil {
println("function: " + fn.Name.Name)
}
}
}
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
ARCHIVED, SEE: https://github.com/go-toolsmith/astp Collection of Go AST predicates
License
cristaloleg/astp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
ARCHIVED, SEE: https://github.com/go-toolsmith/astp Collection of Go AST predicates
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published