aboutsummaryrefslogtreecommitdiffhomepage
path: root/common/maps
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-12-02 13:23:25 +0100
committerBjørn Erik Pedersen <[email protected]>2020-12-03 13:12:58 +0100
commitd90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch)
tree7b1b14464eefec1188ca2eed53c64e4823453cc9 /common/maps
parent32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff)
downloadhugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.tar.gz
hugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.zip
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'common/maps')
-rw-r--r--common/maps/maps_test.go1
-rw-r--r--common/maps/params.go1
-rw-r--r--common/maps/params_test.go4
-rw-r--r--common/maps/scratch.go1
-rw-r--r--common/maps/scratch_test.go3
5 files changed, 0 insertions, 10 deletions
diff --git a/common/maps/maps_test.go b/common/maps/maps_test.go
index bde77071d..7e527aac5 100644
--- a/common/maps/maps_test.go
+++ b/common/maps/maps_test.go
@@ -154,5 +154,4 @@ func TestRenameKeys(t *testing.T) {
if !reflect.DeepEqual(expected, m) {
t.Errorf("Expected\n%#v, got\n%#v\n", expected, m)
}
-
}
diff --git a/common/maps/params.go b/common/maps/params.go
index 5e973051b..4c881093c 100644
--- a/common/maps/params.go
+++ b/common/maps/params.go
@@ -80,7 +80,6 @@ func GetNestedParam(keyStr, separator string, candidates ...Params) (interface{}
}
return nil, nil
-
}
func GetNestedParamFn(keyStr, separator string, lookupFn func(key string) interface{}) (interface{}, string, map[string]interface{}, error) {
diff --git a/common/maps/params_test.go b/common/maps/params_test.go
index 46d672d87..df8cbf8d6 100644
--- a/common/maps/params_test.go
+++ b/common/maps/params_test.go
@@ -20,7 +20,6 @@ import (
)
func TestGetNestedParam(t *testing.T) {
-
m := map[string]interface{}{
"string": "value",
"first": 1,
@@ -48,12 +47,10 @@ func TestGetNestedParam(t *testing.T) {
c.Assert(must("nested.nestednested.color", ".", m), qt.Equals, "green")
c.Assert(must("string.name", ".", m), qt.IsNil)
c.Assert(must("nested.foo", ".", m), qt.IsNil)
-
}
// https://github.com/gohugoio/hugo/issues/7903
func TestGetNestedParamFnNestedNewKey(t *testing.T) {
-
c := qt.New(t)
nested := map[string]interface{}{
@@ -71,5 +68,4 @@ func TestGetNestedParamFnNestedNewKey(t *testing.T) {
c.Assert(existing, qt.IsNil)
c.Assert(nestedKey, qt.Equals, "new")
c.Assert(owner, qt.DeepEquals, nested)
-
}
diff --git a/common/maps/scratch.go b/common/maps/scratch.go
index 7a3cd3748..ccd03ef32 100644
--- a/common/maps/scratch.go
+++ b/common/maps/scratch.go
@@ -51,7 +51,6 @@ func NewScratcher() Scratcher {
//
// If the first add for a key is an array or slice, then the next value(s) will be appended.
func (c *Scratch) Add(key string, newAddend interface{}) (string, error) {
-
var newVal interface{}
c.mu.RLock()
existingAddend, found := c.values[key]
diff --git a/common/maps/scratch_test.go b/common/maps/scratch_test.go
index 40df3bb6b..d893ccb03 100644
--- a/common/maps/scratch_test.go
+++ b/common/maps/scratch_test.go
@@ -53,7 +53,6 @@ func TestScratchAdd(t *testing.T) {
if err == nil {
t.Errorf("Expected error from invalid arithmetic")
}
-
}
func TestScratchAddSlice(t *testing.T) {
@@ -96,7 +95,6 @@ func TestScratchAddTypedSliceToInterfaceSlice(t *testing.T) {
_, err := scratch.Add("slice", []int{1, 2})
c.Assert(err, qt.IsNil)
c.Assert(scratch.Get("slice"), qt.DeepEquals, []int{1, 2})
-
}
// https://github.com/gohugoio/hugo/issues/5361
@@ -110,7 +108,6 @@ func TestScratchAddDifferentTypedSliceToInterfaceSlice(t *testing.T) {
_, err := scratch.Add("slice", []int{1, 2})
c.Assert(err, qt.IsNil)
c.Assert(scratch.Get("slice"), qt.DeepEquals, []interface{}{"foo", 1, 2})
-
}
func TestScratchSet(t *testing.T) {