From d2c0fdf3e0166f7ba2b82df74a2b5d858c00178e Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 23 Jan 2024 20:20:20 +0100 Subject: good loading errmsg --- src/c_init.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/c_init.go') diff --git a/src/c_init.go b/src/c_init.go index 5d399e2..5c9f115 100644 --- a/src/c_init.go +++ b/src/c_init.go @@ -92,24 +92,23 @@ func c_recurse_data_dir(dir, root string, opts HardOpts, host_node, err := c_read_yaml_file(root + dir + filename, ui) if err != nil { *load_err = append(*load_err, err) - return - } else if host_node == nil { - return + } else if host_node != nil { + host_node.Filename = filename + host_node.Parent = &dir_node + dir_node.lhost.add_back(host_node) } - host_node.Filename = filename - host_node.Parent = &dir_node - dir_node.lhost.add_back(host_node) i_draw_load_ui(ui) } } } -func c_load_data_dir(dir string, opts HardOpts, ui *HardUI) (*DirsList, *[]error) { +func c_load_data_dir(dir string, opts HardOpts, + ui *HardUI) (*DirsList, []error) { ldirs := DirsList{} var load_err []error c_recurse_data_dir("", dir + "/", opts, &ldirs, "", nil, 1, ui, &load_err) - return &ldirs, &load_err + return &ldirs, load_err } // fills litems sorting with dirs last -- cgit v1.2.3