From c92fde498836fa3b327e35a27b8d503edea68a9c Mon Sep 17 00:00:00 2001 From: bjt-user Date: Mon, 6 May 2024 01:32:35 +0200 Subject: [PATCH] removed get_parents func --- main.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/main.go b/main.go index 1a0fa05..c144c6b 100644 --- a/main.go +++ b/main.go @@ -33,22 +33,6 @@ func get_heading_level(heading_text string) int { return level } -func get_parents(headings []heading) { - for index, _ := range headings { - if index == 0 { - headings[index].parent = nil - continue - } - - for i := (index - 1); i >= 0; i-- { - if headings[i].level < headings[index].level { - headings[index].parent = &headings[i] - break - } - } - } -} - func parse_file(file_name string) []heading { file_content_raw, err := os.ReadFile(file_name) @@ -76,8 +60,6 @@ func main() { headings = parse_file(file_name) - get_parents(headings) - fmt.Println(path.Base(file_name)) tree(-1, "", headings) }