From 8cdbc778e53914ad7ac28f981590f1d8c7083b1a Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Tue, 17 Aug 2021 23:01:13 +0500 Subject: [PATCH] Run gofmt on cmd/gmnhg This fixes minor formatting issues from c2f2386. --- cmd/gmnhg/main.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/gmnhg/main.go b/cmd/gmnhg/main.go index f5c2df4..8fdf8c8 100644 --- a/cmd/gmnhg/main.go +++ b/cmd/gmnhg/main.go @@ -110,9 +110,9 @@ const ( ) var ( - tmplNameRegex = regexp.MustCompile("^" + templateBase + `([\w-_ /]+)\.gotmpl$`) - leafIndexRegex = regexp.MustCompile("^" + contentBase + `([\w-_ /]+)/index\.[\w]+$`) - pagePathRegex = regexp.MustCompile("^" + contentBase + `([\w-_ /]+)/([\w-_ ]+)\.md$`) + tmplNameRegex = regexp.MustCompile("^" + templateBase + `([\w-_ /]+)\.gotmpl$`) + leafIndexRegex = regexp.MustCompile("^" + contentBase + `([\w-_ /]+)/index\.[\w]+$`) + pagePathRegex = regexp.MustCompile("^" + contentBase + `([\w-_ /]+)/([\w-_ ]+)\.md$`) ) var hugoConfigFiles = []string{"config.toml", "config.yaml", "config.json"} @@ -163,12 +163,12 @@ func writeFile(dst string, contents []byte) error { } func hasSubPath(paths []string, path string) bool { - for _, p := range paths { - if strings.HasPrefix(path, p + "/") { + for _, p := range paths { + if strings.HasPrefix(path, p+"/") { return true } - } - return false + } + return false } var version = "v0+HEAD" @@ -245,7 +245,7 @@ func main() { return nil } if matches := leafIndexRegex.FindStringSubmatch(path); matches != nil { - leafIndexPaths = append(leafIndexPaths, contentBase + matches[1]) + leafIndexPaths = append(leafIndexPaths, contentBase+matches[1]) } return nil }); err != nil { @@ -289,7 +289,7 @@ func main() { // include normal pages in all subdirectory indices for i, dir := range dirs { if i > 0 { - dirs[i] = dirs[i - 1] + "/" + dir + dirs[i] = dirs[i-1] + "/" + dir } } for _, dir := range dirs {