Skip to content

Commit a795acb

Browse files
committed
all: Run gofumpt -l -w .
1 parent 982d951 commit a795acb

File tree

77 files changed

+109
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+109
-210
lines changed

cache/filecache/filecache_config.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package filecache
1616

1717
import (
18+
"errors"
1819
"fmt"
1920
"path"
2021
"path/filepath"
@@ -24,8 +25,6 @@ import (
2425
"github.com/gohugoio/hugo/common/maps"
2526
"github.com/gohugoio/hugo/config"
2627

27-
"errors"
28-
2928
"github.com/mitchellh/mapstructure"
3029
"github.com/spf13/afero"
3130
)
@@ -225,7 +224,6 @@ func DecodeConfig(fs afero.Fs, bcfg config.BaseConfig, m map[string]any) (Config
225224

226225
// Resolves :resourceDir => /myproject/resources etc., :cacheDir => ...
227226
func resolveDirPlaceholder(fs afero.Fs, bcfg config.BaseConfig, placeholder string) (cacheDir string, isResource bool, err error) {
228-
229227
switch strings.ToLower(placeholder) {
230228
case ":resourcedir":
231229
return "", true, nil

cache/filecache/filecache_pruner.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func (c *Cache) Prune(force bool) (int, error) {
6060
counter := 0
6161

6262
err := afero.Walk(c.Fs, "", func(name string, info os.FileInfo, err error) error {
63-
6463
if info == nil {
6564
return nil
6665
}
@@ -69,7 +68,6 @@ func (c *Cache) Prune(force bool) (int, error) {
6968

7069
if info.IsDir() {
7170
f, err := c.Fs.Open(name)
72-
7371
if err != nil {
7472
// This cache dir may not exist.
7573
return nil

codegen/methods.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ func collectMethodsRecursive(pkg string, f []*ast.Field) []string {
461461
pkg,
462462
tt.Methods.List)...)
463463
}
464-
465464
} else {
466465
// Embedded, but in a different file/package. Return the
467466
// package.Name and deal with that later.

common/collections/append_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestAppend(t *testing.T) {
5555
[]any{&tstSlicerIn1{"c"}},
5656
testSlicerInterfaces{&tstSlicerIn1{"a"}, &tstSlicerIn1{"b"}, &tstSlicerIn1{"c"}},
5757
},
58-
//https://github.com/gohugoio/hugo/issues/5361
58+
// https://github.com/gohugoio/hugo/issues/5361
5959
{
6060
[]string{"a", "b"},
6161
[]any{tstSlicers{&tstSlicer{"a"}, &tstSlicer{"b"}}},
@@ -102,22 +102,25 @@ func TestAppendToMultiDimensionalSlice(t *testing.T) {
102102
from []any
103103
expected any
104104
}{
105-
{[][]string{{"a", "b"}},
105+
{
106+
[][]string{{"a", "b"}},
106107
[]any{[]string{"c", "d"}},
107108
[][]string{
108109
{"a", "b"},
109110
{"c", "d"},
110111
},
111112
},
112-
{[][]string{{"a", "b"}},
113+
{
114+
[][]string{{"a", "b"}},
113115
[]any{[]string{"c", "d"}, []string{"e", "f"}},
114116
[][]string{
115117
{"a", "b"},
116118
{"c", "d"},
117119
{"e", "f"},
118120
},
119121
},
120-
{[][]string{{"a", "b"}},
122+
{
123+
[][]string{{"a", "b"}},
121124
[]any{[]int{1, 2}},
122125
false,
123126
},
@@ -130,7 +133,6 @@ func TestAppendToMultiDimensionalSlice(t *testing.T) {
130133
c.Assert(result, qt.DeepEquals, test.expected)
131134
}
132135
}
133-
134136
}
135137

136138
func TestAppendShouldMakeACopyOfTheInputSlice(t *testing.T) {

common/collections/slice.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func StringSliceToInterfaceSlice(ss []string) []any {
7373
result[i] = s
7474
}
7575
return result
76-
7776
}
7877

7978
type SortedStringSlice []string

common/collections/slice_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,4 @@ func TestSortedStringSlice(t *testing.T) {
135135
c.Assert(s.Count("b"), qt.Equals, 3)
136136
c.Assert(s.Count("z"), qt.Equals, 0)
137137
c.Assert(s.Count("a"), qt.Equals, 1)
138-
139138
}

common/hexec/exec.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ import (
1919
"errors"
2020
"fmt"
2121
"io"
22-
"regexp"
23-
"strings"
24-
2522
"os"
2623
"os/exec"
24+
"regexp"
25+
"strings"
2726

2827
"github.com/cli/safeexec"
2928
"github.com/gohugoio/hugo/config"
@@ -142,7 +141,6 @@ func (e *Exec) New(name string, arg ...any) (Runner, error) {
142141
}
143142

144143
return cm.command(arg...)
145-
146144
}
147145

148146
// Npx is a convenience method to create a Runner running npx --no-install <name> <args.

common/htime/time_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func TestTimeFormatter(t *testing.T) {
5353
c.Assert(f.Format(june06, ":time_long"), qt.Equals, "02:09:37 UTC")
5454
c.Assert(f.Format(june06, ":time_medium"), qt.Equals, "02:09:37")
5555
c.Assert(f.Format(june06, ":time_short"), qt.Equals, "02:09")
56-
5756
})
5857

5958
c.Run("Custom layouts English", func(c *qt.C) {
@@ -68,7 +67,6 @@ func TestTimeFormatter(t *testing.T) {
6867
c.Assert(f.Format(june06, ":time_long"), qt.Equals, "2:09:37 am UTC")
6968
c.Assert(f.Format(june06, ":time_medium"), qt.Equals, "2:09:37 am")
7069
c.Assert(f.Format(june06, ":time_short"), qt.Equals, "2:09 am")
71-
7270
})
7371

7472
c.Run("English", func(c *qt.C) {
@@ -107,9 +105,7 @@ func TestTimeFormatter(t *testing.T) {
107105
c.Assert(tr.MonthWide(date.Month()), qt.Equals, monthWideNorway)
108106
c.Assert(f.Format(date, "January"), qt.Equals, monthWideNorway)
109107
}
110-
111108
})
112-
113109
}
114110

115111
func BenchmarkTimeFormatter(b *testing.B) {

common/maps/maps_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,4 @@ func TestLookupEqualFold(t *testing.T) {
192192
v, found = LookupEqualFold(m2, "b")
193193
c.Assert(found, qt.IsTrue)
194194
c.Assert(v, qt.Equals, "bv")
195-
196195
}

common/maps/params_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ func TestParamsSetAndMerge(t *testing.T) {
154154
"a": "av",
155155
"c": "cv",
156156
})
157-
158157
}
159158

160159
func TestParamsIsZero(t *testing.T) {

0 commit comments

Comments
 (0)