MCPcopy
hub / github.com/wagoodman/dive / NewFileTree

Function NewFileTree

dive/filetree/file_tree.go:35–44  ·  view source on GitHub ↗

NewFileTree creates an empty FileTree

()

Source from the content-addressed store, hash-verified

33
34// NewFileTree creates an empty FileTree
35func NewFileTree() (tree *FileTree) {
36 tree = new(FileTree)
37 tree.Size = 0
38 tree.Root = new(FileNode)
39 tree.Root.Tree = tree
40 tree.Root.Children = make(map[string]*FileNode)
41 tree.Id = uuid.New()
42 tree.SortOrder = ByName
43 return tree
44}
45
46// renderParams is a representation of a FileNode in the context of the greater tree. All
47// data stored is necessary for rendering a single line in a tree format.

Callers 15

processLayerTarFunction · 0.92
TestStringCollapsedFunction · 0.85
TestStringFunction · 0.85
TestStringBetweenFunction · 0.85
TestAddRelativePathFunction · 0.85
TestAddPathFunction · 0.85
TestAddWhiteoutPathFunction · 0.85
TestRemovePathFunction · 0.85
TestStackFunction · 0.85
TestCopyFunction · 0.85
TestCompareWithNoChangesFunction · 0.85

Calls

no outgoing calls

Tested by 15

TestStringCollapsedFunction · 0.68
TestStringFunction · 0.68
TestStringBetweenFunction · 0.68
TestAddRelativePathFunction · 0.68
TestAddPathFunction · 0.68
TestAddWhiteoutPathFunction · 0.68
TestRemovePathFunction · 0.68
TestStackFunction · 0.68
TestCopyFunction · 0.68
TestCompareWithNoChangesFunction · 0.68
TestCompareWithAddsFunction · 0.68