Skip to content

Commit ca92d7c

Browse files
committed
Remove printTree debugging flag
1 parent 448fb82 commit ca92d7c

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ var (
2525
recurse bool
2626
sortOutput bool
2727
silent bool
28-
printTree bool // for debugging
2928
)
3029

3130
// Initialize flags.
@@ -35,7 +34,6 @@ func init() {
3534
flag.BoolVar(&recurse, "R", false, "recurse into directories in the file list")
3635
flag.BoolVar(&sortOutput, "sort", true, "sort tags")
3736
flag.BoolVar(&silent, "silent", false, "do not produce any output on error")
38-
flag.BoolVar(&printTree, "tree", false, "print syntax tree (debugging)")
3937

4038
flag.Usage = func() {
4139
fmt.Fprintf(os.Stderr, "gotags version %s\n\n", Version)
@@ -142,11 +140,6 @@ func main() {
142140
os.Exit(1)
143141
}
144142

145-
if printTree {
146-
PrintTree(flag.Arg(0))
147-
return
148-
}
149-
150143
tags := []Tag{}
151144
for _, file := range files {
152145
ts, err := Parse(file)

parser.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ type tagParser struct {
1515
types []string // all types we encounter, used to determine the constructors
1616
}
1717

18-
// PrintTree prints the ast of the source in filename.
19-
func PrintTree(filename string) error {
20-
fset := token.NewFileSet()
21-
f, err := parser.ParseFile(fset, filename, nil, 0)
22-
if err != nil {
23-
return err
24-
}
25-
26-
ast.Print(fset, f)
27-
return nil
28-
}
29-
3018
// Parse parses the source in filename and returns a list of tags.
3119
func Parse(filename string) ([]Tag, error) {
3220
p := &tagParser{

0 commit comments

Comments
 (0)