shithub: hugo

Download patch

ref: 4bfa1890319c5289df1c5525c41bae039574cc70
parent: a2ec372a031f697e3a147a251b633b31789e3c6d
author: Albert Nigmatzianov <albertnigma@gmail.com>
date: Wed Mar 8 08:58:58 EST 2017

hugolib: Remove unnecessary params

Found by github.com/mvdan/unparam

--- a/hugolib/hugo_sites.go
+++ b/hugolib/hugo_sites.go
@@ -478,7 +478,7 @@
 
 	if len(h.Sites) > 1 {
 		pages := h.Sites[0].AllPages
-		allTranslations := pagesToTranslationsMap(h.multilingual, pages)
+		allTranslations := pagesToTranslationsMap(pages)
 		assignTranslationsToPages(allTranslations, pages)
 	}
 }
@@ -524,7 +524,7 @@
 				}
 
 				var err error
-				if workContentCopy, err = handleShortcodes(p, s.Tmpl, workContentCopy); err != nil {
+				if workContentCopy, err = handleShortcodes(p, workContentCopy); err != nil {
 					s.Log.ERROR.Printf("Failed to handle shortcodes for page %s: %s", p.BaseFileName(), err)
 				}
 
@@ -571,7 +571,7 @@
 	return h.Sites[0].AllPages
 }
 
-func handleShortcodes(p *Page, t tpl.Template, rawContentCopy []byte) ([]byte, error) {
+func handleShortcodes(p *Page, rawContentCopy []byte) ([]byte, error) {
 	if len(p.contentShortCodes) > 0 {
 		p.s.Log.DEBUG.Printf("Replace %d shortcodes in %q", len(p.contentShortCodes), p.BaseFileName())
 		shortcodes, err := executeShortcodeFuncMap(p.contentShortCodes)
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -666,7 +666,7 @@
 	}
 
 	go incrementalReadCollator(s, readResults, pageChan, fileConvChan, coordinator, errs)
-	go converterCollator(s, convertResults, errs)
+	go converterCollator(convertResults, errs)
 
 	for _, ev := range sourceReallyChanged {
 
@@ -1182,7 +1182,7 @@
 		go pageConverter(pageChan, results, wg)
 	}
 
-	go converterCollator(s, results, errs)
+	go converterCollator(results, errs)
 
 	for _, p := range s.rawAllPages {
 		if p.shouldBuild() {
@@ -1266,7 +1266,7 @@
 	}
 }
 
-func converterCollator(s *Site, results <-chan HandledResult, errs chan<- error) {
+func converterCollator(results <-chan HandledResult, errs chan<- error) {
 	errMsgs := []string{}
 	for r := range results {
 		if r.err != nil {
--- a/hugolib/translations.go
+++ b/hugolib/translations.go
@@ -22,7 +22,7 @@
 // filename.
 type Translations map[string]*Page
 
-func pagesToTranslationsMap(ml *Multilingual, pages []*Page) map[string]Translations {
+func pagesToTranslationsMap(pages []*Page) map[string]Translations {
 	out := make(map[string]Translations)
 
 	for _, page := range pages {
--