hugolib: apply some Hugolint rules
authorbep <bjorn.erik.pedersen@gmail.com>
Fri, 6 Mar 2015 23:13:06 +0000 (00:13 +0100)
committerbep <bjorn.erik.pedersen@gmail.com>
Fri, 6 Mar 2015 23:13:06 +0000 (00:13 +0100)
hugolib/handler_base.go
hugolib/handler_page.go

index 7f02973c5edef5c1f1b050005f7b91b6ea88e039..f74409166ac81e731bd80998005bbbe5b604bd41 100644 (file)
@@ -56,6 +56,6 @@ func (h HandledResult) String() string {
        return h.Error()
 }
 
-func (hr HandledResult) Page() *Page {
-       return hr.page
+func (h HandledResult) Page() *Page {
+       return h.page
 }
index b3b236344c24dfc74a70a9458af090fd9ca6df1d..5e92ff7e93f490811c232ffd04845f0a9bd66d2f 100644 (file)
@@ -65,9 +65,8 @@ func (h markdownHandler) PageConvert(p *Page, t tpl.Template) HandledResult {
                if err != nil {
                        jww.FATAL.Printf("Fail to replace short code tokens in %s:\n%s", p.BaseFileName(), err.Error())
                        return HandledResult{err: err}
-               } else {
-                       tmpContent = tmpContentWithTokensReplaced
                }
+               tmpContent = tmpContentWithTokensReplaced
        }
 
        p.Content = helpers.BytesToHTML(tmpContent)
@@ -118,9 +117,8 @@ func (h rstHandler) PageConvert(p *Page, t tpl.Template) HandledResult {
                if err != nil {
                        jww.FATAL.Printf("Fail to replace short code tokens in %s:\n%s", p.BaseFileName(), err.Error())
                        return HandledResult{err: err}
-               } else {
-                       tmpContent = tmpContentWithTokensReplaced
                }
+               tmpContent = tmpContentWithTokensReplaced
        }
 
        p.Content = helpers.BytesToHTML(tmpContent)