all: Remove unused code

Using x/tools/cmd/deadcode
This commit is contained in:
Bjørn Erik Pedersen
2023-12-18 17:41:15 +01:00
parent 6f13430d4a
commit 8adba648cc
30 changed files with 32 additions and 405 deletions

View File

@@ -50,7 +50,6 @@ import (
"github.com/gohugoio/hugo/resources/kinds"
"github.com/gohugoio/hugo/resources/page"
"github.com/gohugoio/hugo/resources/page/pagemeta"
"github.com/gohugoio/hugo/tpl"
)
// HugoSites represents the sites to build. Each site represents a language.
@@ -319,21 +318,6 @@ func (h *HugoSites) loadGitInfo() error {
return nil
}
func (s *Site) withSiteTemplates(withTemplates ...func(templ tpl.TemplateManager) error) func(templ tpl.TemplateManager) error {
return func(templ tpl.TemplateManager) error {
for _, wt := range withTemplates {
if wt == nil {
continue
}
if err := wt(templ); err != nil {
return err
}
}
return nil
}
}
// Reset resets the sites and template caches etc., making it ready for a full rebuild.
func (h *HugoSites) reset(config *BuildCfg) {
if config.ResetState {
@@ -659,7 +643,6 @@ func (h *HugoSites) errWithFileContext(err error, f source.File) error {
realFilename := fim.Meta().Filename
return herrors.NewFileErrorFromFile(err, realFilename, h.SourceSpec.Fs.Source, nil)
}
func (h *HugoSites) readData(f source.File) (any, error) {