summaryrefslogtreecommitdiffstats
path: root/modules/client.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-02 13:23:25 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-03 13:12:58 +0100
commitd90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch)
tree7b1b14464eefec1188ca2eed53c64e4823453cc9 /modules/client.go
parent32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff)
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'modules/client.go')
-rw-r--r--modules/client.go18
1 files changed, 5 insertions, 13 deletions
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
}