This commit is contained in:
Bel LaPointe
2022-02-15 12:17:26 -07:00
parent 5888a31cd6
commit cf60d8330e
2 changed files with 84 additions and 75 deletions

View File

@@ -38,40 +38,32 @@ func main() {
data := map[string]interface{}{
"This": map[string]interface{}{
"ID": "id00/id11",
"Title": "title11",
"Title": "title id11",
"PID": "id00",
"PTitle": "title00",
},
"Tree": []map[string]interface{}{
map[string]interface{}{
"ID": "id00",
"Title": "title00",
"PID": "",
"PTitle": "",
},
map[string]interface{}{
"ID": "id00/id10",
"Title": "title10",
},
map[string]interface{}{
"ID": "id00/id11",
"Title": "title11",
"PID": "",
"PTitle": "",
},
map[string]interface{}{
"ID": "id00/id11/id20",
"Title": "title20",
"PID": "",
"PTitle": "",
},
map[string]interface{}{
"ID": "id01",
"Title": "title01",
"PID": "",
"PTitle": "",
},
"PTitle": "title id00",
},
"Tree": `{
"Leaf": {"Title": ""},
"Branches": {
"id00": {
"Leaf": {"Title": "title id00"},
"Branches": {
"id10": {"Leaf":{"Title":"title id10"},"Branches":{
"id20": {"Leaf":{"Title":"title id20"},"Branches":{}}
}},
"id11": {"Leaf":{"Title":"title id11"},"Branches":{}}
}
},
"id01": {"Leaf":{"Title":"title id01"},"Branches":{}},
"id02": {"Leaf":{"Title":"title id02"},"Branches":{}},
"id03": {"Leaf":{"Title":"title id03"},"Branches":{}},
"id04": {"Leaf":{"Title":"title id04"},"Branches":{}},
"id04": {"Leaf":{"Title":"title id04"},"Branches":{}},
"id05": {"Leaf":{"Title":"title id05"},"Branches":{}},
"id06": {"Leaf":{"Title":"title id06"},"Branches":{}},
"id07": {"Leaf":{"Title":"title id07"},"Branches":{}}
}
}`,
}
if err := recursePwd(func(p string) error {
switch path.Ext(p) {