shithub: hugo

Download patch

ref: 3526afc7730ce5bd853ea4a8edd6cce7a8dc8a5f
parent: 58a183c330539673590dff91190a807122b706db
author: Bjørn Erik Pedersen <[email protected]>
date: Fri Jan 15 19:28:48 EST 2016

Fix some Go vet errors

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -135,6 +135,7 @@
 // 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 @@
 	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 @@
 	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 @@
 		} 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())