Fix some Go vet errors - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 3526afc7730ce5bd853ea4a8edd6cce7a8dc8a5f
DIR parent 58a183c330539673590dff91190a807122b706db
HTML Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Sat, 16 Jan 2016 00:28:48 +0100
Fix some Go vet errors
Diffstat:
M hugolib/site.go | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
DIR diff --git a/hugolib/site.go b/hugolib/site.go
@@ -135,6 +135,7 @@ type SiteInfo struct {
// linkedin
type SiteSocial map[string]string
+// GetParam gets a site parameter value if found, nil if not.
func (s *SiteInfo) GetParam(key string) interface{} {
v := s.Params[strings.ToLower(key)]
@@ -209,14 +210,17 @@ func (s *SiteInfo) refLink(ref string, page *Page, relative bool) (string, error
return link, nil
}
+// Ref will give an absolute URL to ref in the given Page.
func (s *SiteInfo) Ref(ref string, page *Page) (string, error) {
return s.refLink(ref, page, false)
}
+// RelRef will give an relative URL to ref in the given Page.
func (s *SiteInfo) RelRef(ref string, page *Page) (string, error) {
return s.refLink(ref, page, true)
}
+// TODO(sven): Document
func (s *SiteInfo) GitHub(ref string, page *Page) (string, error) {
return s.githubLink(ref, page, true)
}
@@ -308,6 +312,7 @@ func (s *SiteInfo) githubLink(ref string, currentPage *Page, relative bool) (str
return link, nil
}
+// TODO(sven): Document
func (s *SiteInfo) GitHubFileLink(ref string, page *Page) (string, error) {
return s.githubFileLink(ref, page, false)
}
@@ -366,12 +371,6 @@ func (s *SiteInfo) githubFileLink(ref string, currentPage *Page, relative bool)
} else {
return "/" + filepath.ToSlash(link), nil
}
-
- if err != nil {
- return "", err
- }
-
- return link, nil
}
return "", fmt.Errorf("failed to find a file to match \"%s\" on page \"%s\"", ref, currentPage.Source.Path())