Skip to content

Commit

Permalink
Omit parent when marshalling to json
Browse files Browse the repository at this point in the history
Otherwise it will continue to recurse and stack overflow
  • Loading branch information
Zachary Scott authored and dcarley committed Jun 15, 2018
1 parent 1eea784 commit 50c34db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions filetree/filetree.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (

// Node represents a leaf in the filetree
type Node struct {
FullPath string
Info os.FileInfo
Children []*Node
Parent *Node
FullPath string `json:"full_path"`
Info os.FileInfo `json:"info"`
Children []*Node `json:"children"`
Parent *Node `json:"-"`
}

// Helper function that returns true if a path exists in excludes array
Expand Down

0 comments on commit 50c34db

Please sign in to comment.