diff --git a/fileBrowser.go b/fileBrowser.go index 4727ccb..f7cab5f 100644 --- a/fileBrowser.go +++ b/fileBrowser.go @@ -2,6 +2,7 @@ package main import ( "strings" + "fmt" ) type FileNode struct{ @@ -19,29 +20,32 @@ func (f *FileNode) addChildNode(m FileNode){ f.children = append(f.children, m) } -func mapGenerator(fileList [] string) map[string][]string { - var a map[string][]string = make(map[string][]string) - for i := range(fileList){ - a[strings.Split(fileList[i] , "/")[0]] = append(a[strings.Split(fileList[i] , "/")[0]], strings.Split(fileList[i] , "/")[1]) - } - return a -} - -func generateDirectoryTree(fileList [] string) *FileNode{ +func generateDirectoryTree(path [] string) *FileNode{ var head *FileNode = new(FileNode) - for i:=0; i