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 --- modules/client.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'modules/client.go') diff --git a/modules/client.go b/modules/client.go index 7d2175c94..88c1e933e 100644 --- a/modules/client.go +++ b/modules/client.go @@ -25,6 +25,8 @@ import ( "os/exec" "path/filepath" "regexp" + "strings" + "time" hglob "github.com/gohugoio/hugo/hugofs/glob" @@ -36,9 +38,6 @@ import ( "github.com/gohugoio/hugo/common/loggers" - "strings" - "time" - "github.com/gohugoio/hugo/config" "github.com/rogpeppe/go-internal/module" @@ -49,9 +48,7 @@ import ( "github.com/spf13/afero" ) -var ( - fileSeparator = string(os.PathSeparator) -) +var fileSeparator = string(os.PathSeparator) const ( goBinaryStatusOK goBinaryStatus = iota @@ -93,7 +90,6 @@ func NewClient(cfg ClientConfig) *Client { if cfg.CacheDir != "" { // Module cache stored below $GOPATH/pkg config.SetEnvVars(&env, "GOPATH", cfg.CacheDir) - } logger := cfg.Logger @@ -113,7 +109,8 @@ func NewClient(cfg ClientConfig) *Client { noVendor: noVendor, moduleConfig: mcfg, environ: env, - GoModulesFilename: goModFilename} + GoModulesFilename: goModFilename, + } } // Client contains most of the API provided by this package. @@ -165,7 +162,6 @@ func (c *Client) Graph(w io.Writer) error { // Local dir. dep += " => " + replace.Dir() } - } fmt.Fprintln(w, prefix+dep) } @@ -357,7 +353,6 @@ var verifyErrorDirRe = regexp.MustCompile(`dir has been modified \((.*?)\)`) func (c *Client) Verify(clean bool) error { // TODO1 add path to mod clean err := c.runVerify() - if err != nil { if clean { m := verifyErrorDirRe.FindAllStringSubmatch(err.Error(), -1) @@ -450,7 +445,6 @@ func (c *Client) listGoMods() (goModules, error) { } return modules, err - } func (c *Client) rewriteGoMod(name string, isGoMod map[string]bool) error { @@ -515,7 +509,6 @@ func (c *Client) rewriteGoModRewrite(name string, isGoMod map[string]bool) ([]by } return b.Bytes(), nil - } func (c *Client) rmVendorDir(vendorDir string) error { @@ -539,7 +532,6 @@ func (c *Client) runGo( ctx context.Context, stdout io.Writer, args ...string) error { - if c.goBinaryStatus != 0 { return nil } -- cgit v1.2.3