mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Apply gofmt -s
This commit is contained in:
parent
eebf00f702
commit
318a984526
6 changed files with 7 additions and 9 deletions
|
@ -426,7 +426,7 @@ func TruncateWordsByRune(words []string, max int) (string, bool) {
|
|||
} else if count+runeCount < max {
|
||||
count += runeCount
|
||||
} else {
|
||||
for ri, _ := range word {
|
||||
for ri := range word {
|
||||
if count >= max {
|
||||
truncatedWords := append(words[:index], word[:ri])
|
||||
return strings.Join(truncatedWords, " "), true
|
||||
|
|
|
@ -69,7 +69,6 @@ func TestParseDefaultPygmentsArgs(t *testing.T) {
|
|||
{"", nil, nil, "style=foo,noclasses=false"},
|
||||
{"style=foo,noclasses=false", nil, nil, "style=override,noclasses=override"},
|
||||
{"style=foo,noclasses=false", "override", false, "style=override,noclasses=override"},
|
||||
|
||||
} {
|
||||
viper.Reset()
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ func (c *pageCache) get(key string, p Pages, apply func(p Pages)) (Pages, bool)
|
|||
if v, ok := c.m[key]; ok {
|
||||
c.m[key] = append(v, [2]Pages{p, pagesCopy})
|
||||
} else {
|
||||
c.m[key] = [][2]Pages{[2]Pages{p, pagesCopy}}
|
||||
c.m[key] = [][2]Pages{{p, pagesCopy}}
|
||||
}
|
||||
|
||||
return pagesCopy, false
|
||||
|
|
|
@ -74,7 +74,7 @@ func (c *Scratch) GetSortedMapValues(key string) interface{} {
|
|||
unsortedMap := c.values[key].(map[string]interface{})
|
||||
|
||||
var keys []string
|
||||
for mapKey, _ := range unsortedMap {
|
||||
for mapKey := range unsortedMap {
|
||||
keys = append(keys, mapKey)
|
||||
}
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ import (
|
|||
"fmt"
|
||||
"github.com/spf13/cast"
|
||||
"html/template"
|
||||
"math/rand"
|
||||
"path"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
"math/rand"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -345,7 +345,7 @@ func TestAfter(t *testing.T) {
|
|||
func TestShuffleInputAndOutputFormat(t *testing.T) {
|
||||
for i, this := range []struct {
|
||||
sequence interface{}
|
||||
success bool
|
||||
success bool
|
||||
}{
|
||||
{[]string{"a", "b", "c", "d"}, true},
|
||||
{[]int{100, 200, 300}, true},
|
||||
|
@ -406,7 +406,6 @@ func TestShuffleRandomising(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
func TestDictionary(t *testing.T) {
|
||||
for i, this := range []struct {
|
||||
v1 []interface{}
|
||||
|
|
|
@ -270,7 +270,7 @@ func TestGetCSVFailParseSep(t *testing.T) {
|
|||
url := ts.URL + "/test.csv"
|
||||
defer os.Remove(getCacheFileID(url))
|
||||
|
||||
want := [][]string{[]string{"gomeetup", "city"}, []string{"yes", "Sydney"}, []string{"yes", "San Francisco"}, []string{"yes", "Stockholm"}}
|
||||
want := [][]string{{"gomeetup", "city"}, {"yes", "Sydney"}, {"yes", "San Francisco"}, {"yes", "Stockholm"}}
|
||||
have := GetCSV(",", url)
|
||||
assert.NotNil(t, have)
|
||||
if have != nil {
|
||||
|
@ -301,7 +301,7 @@ func TestGetCSVFailParse(t *testing.T) {
|
|||
url := ts.URL + "/test.csv"
|
||||
defer os.Remove(getCacheFileID(url))
|
||||
|
||||
want := [][]string{[]string{"gomeetup", "city"}, []string{"yes", "Sydney"}, []string{"yes", "San Francisco"}, []string{"yes", "Stockholm"}}
|
||||
want := [][]string{{"gomeetup", "city"}, {"yes", "Sydney"}, {"yes", "San Francisco"}, {"yes", "Stockholm"}}
|
||||
have := GetCSV(",", url)
|
||||
assert.NotNil(t, have)
|
||||
if have != nil {
|
||||
|
|
Loading…
Reference in a new issue