hugolib: Remove unnecessary params
authorAlbert Nigmatzianov <albertnigma@gmail.com>
Wed, 8 Mar 2017 08:58:58 +0000 (13:58 +0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 8 Mar 2017 11:28:56 +0000 (12:28 +0100)
Found by github.com/mvdan/unparam

hugolib/hugo_sites.go
hugolib/site.go
hugolib/translations.go

index 0dfcdeb9b39571fec32d396673456419ef04504e..49dd51cd6a3e2d17f4c796bddc1d5ba8232c6cf4 100644 (file)
@@ -478,7 +478,7 @@ func (h *HugoSites) setupTranslations() {
 
        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 @@ func (s *Site) preparePagesForRender(cfg *BuildCfg) {
                                }
 
                                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 @@ func (h *HugoSites) Pages() Pages {
        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)
index 93e3ee740fec7282fe1d4ae31897ffca7b3a9d4a..7b17bbd4b0ec025893209a2faf5288c933fe5013 100644 (file)
@@ -666,7 +666,7 @@ func (s *Site) reProcess(events []fsnotify.Event) (whatChanged, error) {
        }
 
        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 @@ func (s *Site) convertSource() chan error {
                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 fileConverter(s *Site, files <-chan *source.File, results HandleResults, wg
        }
 }
 
-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 {
index 648bcf3224e4fb625e0633c7f6cb590d2f2650e5..b71ae978610f5e6915c032f5e2b686f9f69a1d47 100644 (file)
@@ -22,7 +22,7 @@ import (
 // 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 {