From d90e37e0c6e812f9913bf256c9c81aa05b7a08aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 2 Dec 2020 13:23:25 +0100 Subject: all: Format code with gofumpt See https://github.com/mvdan/gofumpt --- commands/commandeer.go | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'commands/commandeer.go') diff --git a/commands/commandeer.go b/commands/commandeer.go index e0eae4a66..024651aad 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -16,24 +16,22 @@ package commands import ( "bytes" "errors" + "io/ioutil" + "os" + "path/filepath" + "regexp" "sync" + "time" hconfig "github.com/gohugoio/hugo/config" "golang.org/x/sync/semaphore" - "io/ioutil" - "github.com/gohugoio/hugo/common/herrors" "github.com/gohugoio/hugo/common/hugo" jww "github.com/spf13/jwalterweatherman" - "os" - "path/filepath" - "regexp" - "time" - "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/config" @@ -156,7 +154,6 @@ func (c *commandeer) initFs(fs *hugofs.Fs) error { } func newCommandeer(mustHaveConfigFile, running bool, h *hugoBuilderCommon, f flagsToConfigHandler, cfgInit func(c *commandeer) error, subCmdVs ...*cobra.Command) (*commandeer, error) { - var rebuildDebouncer func(f func()) if running { // The time value used is tested with mass content replacements in a fairly big Hugo site. @@ -248,7 +245,6 @@ func (f *fileChangeDetector) PrepareNew() { } func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { - if c.DepsCfg == nil { c.DepsCfg = &deps.DepsCfg{} } @@ -277,7 +273,6 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { environment := c.h.getEnvironment(running) doWithConfig := func(cfg config.Provider) error { - if c.ftch != nil { c.ftch.flagsToConfig(cfg) } @@ -309,7 +304,8 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { Filename: c.h.cfgFile, AbsConfigDir: c.h.getConfigDir(dir), Environ: os.Environ(), - Environment: environment}, + Environment: environment, + }, cfgSetAndInit, doWithConfig) @@ -389,7 +385,7 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { } // To debug hard-to-find path issues. - //fs.Destination = hugofs.NewStacktracerFs(fs.Destination, `fr/fr`) + // fs.Destination = hugofs.NewStacktracerFs(fs.Destination, `fr/fr`) err = c.initFs(fs) if err != nil { @@ -402,7 +398,6 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { h, err = hugolib.NewHugoSites(*c.DepsCfg) c.hugoSites = h close(c.created) - }) if err != nil { @@ -418,5 +413,4 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { cfg.Logger.Infoln("Using config file:", config.ConfigFileUsed()) return nil - } -- cgit v1.2.3