From 0f4f874b9eda1a377bf670d177d64f14cf64e30f Mon Sep 17 00:00:00 2001 From: dre Date: Sun, 11 Jul 2021 17:09:49 +0800 Subject: [PATCH] clear the right file --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 52b66ea..7a2fa01 100644 --- a/main.go +++ b/main.go @@ -173,6 +173,8 @@ func main() { } for name, section := range sections { + // TODO: come up with sth better as one might have content there. + os.Remove(section.File) section.Write(section.File) fmt.Printf("written section listing %s to %s\n", name, section.File) } @@ -180,8 +182,6 @@ func main() { section, ok := sections[seconOnRoot] if ok { sectionFile := filepath.Join(destination, "index."+ext) - // TODO: come up with sth better as one might have content there. - os.Remove(sectionFile) section.Write(sectionFile) fmt.Printf("written section listing for root to %s\n", section.File) }