From 7e595f4ba400b32ece930de0847d994f6f2fbe24 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 3 Jan 2024 20:20:20 +0100 Subject: unique id maybe? --- c_init.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'c_init.go') diff --git a/c_init.go b/c_init.go index dc42774..3c22e2b 100644 --- a/c_init.go +++ b/c_init.go @@ -62,6 +62,9 @@ type HardOpts struct { FoldAll bool } + +var global_id uint64 + // this function recurses into the specified root directory in order to load // every yaml file into memory func c_recurse_data_dir(dir, root string, opts HardOpts, @@ -80,11 +83,12 @@ func c_recurse_data_dir(dir, root string, opts HardOpts, opts.FoldAll, nil, } - item_node := ItemsNode{} - item_node.Dirs = &dir_node - item_node.Host = nil + // item_node := ItemsNode{} + // item_node.Dirs = &dir_node + // item_node.Host = nil ldirs.add_back(&dir_node) - litems.add_back(&item_node) + global_id++ + // litems.add_back(&item_node) for _, file := range files { filename := file.Name() if file.IsDir() == true { @@ -95,13 +99,14 @@ func c_recurse_data_dir(dir, root string, opts HardOpts, if host_node == nil { return } - item_node := ItemsNode{} - item_node.Dirs = nil - item_node.Host = host_node - litems.add_back(&item_node) + // item_node := ItemsNode{} + // item_node.Dirs = nil + // item_node.Host = host_node + // litems.add_back(&item_node) host_node.Filename = filename - host_node.Dir = &dir_node + host_node.Parent = &dir_node dir_node.lhost.add_back(host_node) + global_id++ } } } -- cgit v1.2.3