all: Format code with gofumpt

See https://github.com/mvdan/gofumpt
This commit is contained in:
Bjørn Erik Pedersen
2020-12-02 13:23:25 +01:00
parent 32471b57bd
commit d90e37e0c6
442 changed files with 1426 additions and 2254 deletions

View File

@@ -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
}