|
@@ -3,6 +3,7 @@ package main
|
|
|
import (
|
|
|
"fmt"
|
|
|
"go/ast"
|
|
|
+ "go/token"
|
|
|
)
|
|
|
|
|
|
func parseFile(f *ast.File) {
|
|
@@ -19,6 +20,15 @@ func parseFile(f *ast.File) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
func parseTypeSpec(loc string, s *ast.TypeSpec) {
|
|
|
- fmt.Printf("%s/typeSpec\n", loc)
|
|
|
+
|
|
|
+
|
|
|
+ name := s.Name.String()
|
|
|
+ if s.Assign == token.NoPos {
|
|
|
+ fmt.Printf("%s/Defined %s: ", loc, name)
|
|
|
+ } else {
|
|
|
+ fmt.Printf("%s/Aliased %s: ", loc, name)
|
|
|
+ }
|
|
|
+ parseTypeExpr(loc, s.Type, true)
|
|
|
}
|