aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-01-28 22:34:10 +0100
committerBjørn Erik Pedersen <[email protected]>2024-01-28 23:14:09 +0100
commita795acbcd8b18aa4af384d5c03f30740361c8fcf (patch)
tree0dbf7b000681a738b892c5235daf52c63cda88b9 /modules
parent982d9513e71b3d48e20cfa38454a0e1215a8d963 (diff)
downloadhugo-a795acbcd8b18aa4af384d5c03f30740361c8fcf.tar.gz
hugo-a795acbcd8b18aa4af384d5c03f30740361c8fcf.zip
all: Run gofumpt -l -w .
Diffstat (limited to 'modules')
-rw-r--r--modules/client.go14
-rw-r--r--modules/config_test.go1
-rw-r--r--modules/module.go2
3 files changed, 7 insertions, 10 deletions
diff --git a/modules/client.go b/modules/client.go
index fae6a4c0a..26117fbcf 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -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
}
diff --git a/modules/config_test.go b/modules/config_test.go
index 5c97caaa2..6dac14e9a 100644
--- a/modules/config_test.go
+++ b/modules/config_test.go
@@ -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) {
diff --git a/modules/module.go b/modules/module.go
index da963de58..8c7316eea 100644
--- a/modules/module.go
+++ b/modules/module.go
@@ -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 {