From a35536c8be6889f4841ddb8a9d5da594ae4029b5 Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Fri, 13 Aug 2021 09:00:37 +0500 Subject: [PATCH] Make linter happy This removes some of the leftovers of older logic in cmd/gmnhg. --- cmd/gmnhg/main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/gmnhg/main.go b/cmd/gmnhg/main.go index 98f1ee7..f21637b 100644 --- a/cmd/gmnhg/main.go +++ b/cmd/gmnhg/main.go @@ -80,9 +80,9 @@ import ( ) const ( - defaultTemplate = "single" - indexMdFilename = "_index.gmi.md" - indexFilename = "index.gmi" + defaultPageTemplate = "single" + indexMdFilename = "_index.gmi.md" + indexFilename = "index.gmi" ) const ( @@ -94,7 +94,6 @@ const ( var ( tmplNameRegex = regexp.MustCompile(templateBase + `([\w-_ /]+)\.gotmpl`) - contentNameRegex = regexp.MustCompile(contentBase + `([\w-_ ]+)\.md`) topLevelPostRegex = regexp.MustCompile(contentBase + `([\w-_ ]+)/([\w-_ ]+)\.md`) ) @@ -201,7 +200,7 @@ func main() { } // render posts to Gemtext and collect top level posts data - posts := make(map[string]*post, 0) + posts := make(map[string]*post) topLevelPosts := make(map[string][]*post) if err := filepath.Walk(contentBase, func(path string, info os.FileInfo, err error) error { if err != nil { @@ -252,7 +251,7 @@ func main() { } var singleTemplate = defaultSingleTemplate - if tmpl, hasTmpl := templates["single"]; hasTmpl { + if tmpl, hasTmpl := templates[defaultPageTemplate]; hasTmpl { singleTemplate = tmpl }