Run gofmt -s
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 23 Mar 2019 19:15:06 +0000 (20:15 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 23 Mar 2019 19:15:06 +0000 (20:15 +0100)
cache/filecache/filecache_config.go
parser/metadecoders/decoder_test.go
tpl/collections/complement_test.go
tpl/collections/symdiff_test.go
tpl/tplimpl/shortcodes_test.go
tpl/transform/unmarshal_test.go
transform/urlreplacers/absurlreplacer_test.go

index 75a9b61ca22fb7f90395bd1a350ec72b9a2df79d..a6a0252b24bb05f8436373162f0a79b7ea891c80 100644 (file)
@@ -47,11 +47,11 @@ const (
 var defaultCacheConfigs = map[string]cacheConfig{
        cacheKeyGetJSON: defaultCacheConfig,
        cacheKeyGetCSV:  defaultCacheConfig,
-       cacheKeyImages: cacheConfig{
+       cacheKeyImages: {
                MaxAge: -1,
                Dir:    resourcesGenDir,
        },
-       cacheKeyAssets: cacheConfig{
+       cacheKeyAssets: {
                MaxAge: -1,
                Dir:    resourcesGenDir,
        },
index 38d002dd8ac3dbe9c99bef6468855a93cf6c97df..146df506900b93c4996018790412ccb919568f91 100644 (file)
@@ -72,7 +72,7 @@ func TestUnmarshalToInterface(t *testing.T) {
                {`#+a: b`, ORG, expect},
                {`a = "b"`, TOML, expect},
                {`a: "b"`, YAML, expect},
-               {`a,b,c`, CSV, [][]string{[]string{"a", "b", "c"}}},
+               {`a,b,c`, CSV, [][]string{{"a", "b", "c"}}},
                {"a: Easy!\nb:\n  c: 2\n  d: [3, 4]", YAML, map[string]interface{}{"a": "Easy!", "b": map[string]interface{}{"c": 2, "d": []interface{}{3, 4}}}},
                // errors
                {`a = "`, TOML, false},
index e5edb23d34bfe3711b590f0d76cb177e5a2f25bb..07611bd5bbe26e2b075c199414799c81359fa2a5 100644 (file)
@@ -37,8 +37,8 @@ func TestComplement(t *testing.T) {
 
        ns := New(&deps.Deps{})
 
-       s1 := []TstX{TstX{A: "a"}, TstX{A: "b"}, TstX{A: "d"}, TstX{A: "e"}}
-       s2 := []TstX{TstX{A: "b"}, TstX{A: "e"}}
+       s1 := []TstX{{A: "a"}, {A: "b"}, {A: "d"}, {A: "e"}}
+       s2 := []TstX{{A: "b"}, {A: "e"}}
 
        xa, xb, xd, xe := &StructWithSlice{A: "a"}, &StructWithSlice{A: "b"}, &StructWithSlice{A: "d"}, &StructWithSlice{A: "e"}
 
@@ -58,15 +58,15 @@ func TestComplement(t *testing.T) {
                {[]interface{}{"a", "b", nil}, []interface{}{[]string{"a", "d"}}, []interface{}{"b", nil}},
                {[]int{1, 2, 3, 4, 5}, []interface{}{[]int{1, 3}, []string{"a", "b"}, []int{1, 2}}, []int{4, 5}},
                {[]int{1, 2, 3, 4, 5}, []interface{}{[]int64{1, 3}}, []int{2, 4, 5}},
-               {s1, []interface{}{s2}, []TstX{TstX{A: "a"}, TstX{A: "d"}}},
+               {s1, []interface{}{s2}, []TstX{{A: "a"}, {A: "d"}}},
                {sp1, []interface{}{sp2}, []*StructWithSlice{xa, xd}},
                {sp1_2, []interface{}{sp2_2}, StructWithSlicePointers{xa, xd}},
 
                // Errors
                {[]string{"a", "b", "c"}, []interface{}{"error"}, false},
                {"error", []interface{}{[]string{"c", "d"}, []string{"a", "b"}}, false},
-               {[]string{"a", "b", "c"}, []interface{}{[][]string{[]string{"c", "d"}}}, false},
-               {[]interface{}{[][]string{[]string{"c", "d"}}}, []interface{}{[]string{"c", "d"}, []string{"a", "b"}}, false},
+               {[]string{"a", "b", "c"}, []interface{}{[][]string{{"c", "d"}}}, false},
+               {[]interface{}{[][]string{{"c", "d"}}}, []interface{}{[]string{"c", "d"}, []string{"a", "b"}}, false},
        } {
 
                errMsg := fmt.Sprintf("[%d]", i)
index 4024ffe7a7bfd9bab592bb89f4f278d53671a10d..b62fdb73b0dcb3b7659ee0fed957625009843b30 100644 (file)
@@ -30,8 +30,8 @@ func TestSymDiff(t *testing.T) {
 
        ns := New(&deps.Deps{})
 
-       s1 := []TstX{TstX{A: "a"}, TstX{A: "b"}}
-       s2 := []TstX{TstX{A: "a"}, TstX{A: "e"}}
+       s1 := []TstX{{A: "a"}, {A: "b"}}
+       s2 := []TstX{{A: "a"}, {A: "e"}}
 
        xa, xb, xd, xe := &StructWithSlice{A: "a"}, &StructWithSlice{A: "b"}, &StructWithSlice{A: "d"}, &StructWithSlice{A: "e"}
 
@@ -48,7 +48,7 @@ func TestSymDiff(t *testing.T) {
                {[]interface{}{"a", "b", nil}, []interface{}{"a"}, []interface{}{"b", nil}},
                {[]int{1, 2, 3}, []int{3, 4}, []int{1, 2, 4}},
                {[]int{1, 2, 3}, []int64{3, 4}, []int{1, 2, 4}},
-               {s1, s2, []TstX{TstX{A: "b"}, TstX{A: "e"}}},
+               {s1, s2, []TstX{{A: "b"}, {A: "e"}}},
                {sp1, sp2, []*StructWithSlice{xa, xd}},
 
                // Errors
index 6909feda72e7c554dbf00fd122643b1cc8cba80d..7439f715aca9cdcb1293cd4bbe9674fbdfd5ef02 100644 (file)
@@ -74,8 +74,8 @@ func TestShortcodesTemplate(t *testing.T) {
 
                s := &shortcodeTemplates{
                        variants: []shortcodeVariant{
-                               shortcodeVariant{variants: []string{"a", "b", "c"}},
-                               shortcodeVariant{variants: []string{"a", "b", "d"}},
+                               {variants: []string{"a", "b", "c"}},
+                               {variants: []string{"a", "b", "d"}},
                        },
                }
 
index 1defe8c9ce0b75f5e541c7b36261fac62a7cd0c3..e91f680c25424f6b37a94d57f57963c2f2e31967 100644 (file)
@@ -119,21 +119,21 @@ func TestUnmarshal(t *testing.T) {
                        assert.Equal("Ford", first[1])
                }},
                {testContentResource{key: "r1", content: `a;b;c`, mime: media.CSVType}, map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
-                       assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
+                       assert.Equal(r, [][]string{{"a", "b", "c"}})
 
                }},
                {"a,b,c", nil, func(r [][]string) {
-                       assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
+                       assert.Equal(r, [][]string{{"a", "b", "c"}})
 
                }},
                {"a;b;c", map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
-                       assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
+                       assert.Equal(r, [][]string{{"a", "b", "c"}})
 
                }},
                {testContentResource{key: "r1", content: `
 % This is a comment
 a;b;c`, mime: media.CSVType}, map[string]interface{}{"DElimiter": ";", "Comment": "%"}, func(r [][]string) {
-                       assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
+                       assert.Equal(r, [][]string{{"a", "b", "c"}})
 
                }},
                // errors
index e7c90adc994b7d6e1590d301714f6f59da1b5d3b..f7a5b16560da0ef7f306126c7f8656a5ce73d4fa 100644 (file)
@@ -160,11 +160,11 @@ func TestAbsURLUnqoted(t *testing.T) {
        tr := transform.New(NewAbsURLTransformer(testBaseURL))
 
        apply(t.Errorf, tr, []test{
-               test{
+               {
                        content:  `Link: <a href=/asdf>ASDF</a>`,
                        expected: `Link: <a href=http://base/asdf>ASDF</a>`,
                },
-               test{
+               {
                        content:  `Link: <a href=/asdf   >ASDF</a>`,
                        expected: `Link: <a href=http://base/asdf   >ASDF</a>`,
                },