all: Run gofumpt -l -w .

This commit is contained in:
Bjørn Erik Pedersen 2024-01-28 22:34:10 +01:00
parent 982d9513e7
commit a795acbcd8
77 changed files with 102 additions and 203 deletions

View file

@ -18,6 +18,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"os"
@ -46,8 +47,6 @@ import (
"github.com/gohugoio/hugo/common/hugio"
"errors"
"github.com/spf13/afero"
)
@ -199,7 +198,7 @@ func (c *Client) Vendor() error {
if err := c.rmVendorDir(vendorDir); err != nil {
return err
}
if err := c.fs.MkdirAll(vendorDir, 0755); err != nil {
if err := c.fs.MkdirAll(vendorDir, 0o755); err != nil {
return err
}
@ -260,7 +259,7 @@ func (c *Client) Vendor() error {
} else {
targetDir := filepath.Dir(targetFilename)
if err := c.fs.MkdirAll(targetDir, 0755); err != nil {
if err := c.fs.MkdirAll(targetDir, 0o755); err != nil {
return fmt.Errorf("failed to make target dir: %w", err)
}
@ -303,7 +302,7 @@ func (c *Client) Vendor() error {
}
if modulesContent.Len() > 0 {
if err := afero.WriteFile(c.fs, filepath.Join(vendorDir, vendorModulesFilename), modulesContent.Bytes(), 0666); err != nil {
if err := afero.WriteFile(c.fs, filepath.Join(vendorDir, vendorModulesFilename), modulesContent.Bytes(), 0o666); err != nil {
return err
}
}
@ -558,7 +557,7 @@ func (c *Client) rewriteGoMod(name string, isGoMod map[string]bool) error {
return err
}
if data != nil {
if err := afero.WriteFile(c.fs, filepath.Join(c.ccfg.WorkingDir, name), data, 0666); err != nil {
if err := afero.WriteFile(c.fs, filepath.Join(c.ccfg.WorkingDir, name), data, 0o666); err != nil {
return err
}
}
@ -636,7 +635,8 @@ func (c *Client) rmVendorDir(vendorDir string) error {
func (c *Client) runGo(
ctx context.Context,
stdout io.Writer,
args ...string) error {
args ...string,
) error {
if c.goBinaryStatus != 0 {
return nil
}

View file

@ -100,7 +100,6 @@ lang="en"
c.Assert(imp.Mounts[1].Source, qt.Equals, "src/markdown/blog")
c.Assert(imp.Mounts[1].Target, qt.Equals, "content/blog")
c.Assert(imp.Mounts[1].Lang, qt.Equals, "en")
})
c.Run("Replacements", func(c *qt.C) {

View file

@ -25,7 +25,6 @@ import (
var _ Module = (*moduleAdapter)(nil)
type Module interface {
// Optional config read from the configFilename above.
Cfg() config.Provider
@ -157,7 +156,6 @@ func (m *moduleAdapter) Time() time.Time {
}
return *m.gomod.Time
}
func (m *moduleAdapter) Watch() bool {