Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-03-23 02:44:51 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-03-23 02:44:51 +0300
commit672890339efabf5a3f3b28f7d38c4a29277bc791 (patch)
tree5c18a2d3185bf94daa9dfe88c0ccd65fa3f6894f /target
parentdc7d8a9eac43760b0cd4599312de9bff072fffd5 (diff)
target: Fix some Golint warnings
Diffstat (limited to 'target')
-rw-r--r--target/htmlredirect.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/target/htmlredirect.go b/target/htmlredirect.go
index 34e05cbad..b5b47a889 100644
--- a/target/htmlredirect.go
+++ b/target/htmlredirect.go
@@ -26,15 +26,15 @@ import (
jww "github.com/spf13/jwalterweatherman"
)
-const ALIAS = "<!DOCTYPE html><html><head><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" /></head></html>"
-const ALIAS_XHTML = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" /></head></html>"
+const alias = "<!DOCTYPE html><html><head><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" /></head></html>"
+const aliasXHtml = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" /></head></html>"
-var DefaultAliasTemplates *template.Template
+var defaultAliasTemplates *template.Template
func init() {
- DefaultAliasTemplates = template.New("")
- template.Must(DefaultAliasTemplates.New("alias").Parse(ALIAS))
- template.Must(DefaultAliasTemplates.New("alias-xhtml").Parse(ALIAS_XHTML))
+ defaultAliasTemplates = template.New("")
+ template.Must(defaultAliasTemplates.New("alias").Parse(alias))
+ template.Must(defaultAliasTemplates.New("alias-xhtml").Parse(aliasXHtml))
}
type AliasPublisher interface {
@@ -96,10 +96,9 @@ func (h *HTMLRedirectAlias) Translate(alias string) (aliasPath string, err error
jww.ERROR.Println(m)
}
return "", fmt.Errorf("Cannot create \"%s\": Windows filename restriction", originalAlias)
- } else {
- for _, m := range msgs {
- jww.WARN.Println(m)
- }
+ }
+ for _, m := range msgs {
+ jww.WARN.Println(m)
}
}
@@ -134,7 +133,7 @@ func (h *HTMLRedirectAlias) Publish(path string, permalink string) (err error) {
t = "alias-xhtml"
}
- template := DefaultAliasTemplates
+ template := defaultAliasTemplates
if h.Templates != nil {
template = h.Templates
}