Apply gofmt -s

This commit is contained in:
Bjørn Erik Pedersen 2016-02-06 12:29:13 +01:00
parent eebf00f702
commit 318a984526
6 changed files with 7 additions and 9 deletions

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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)
}

View File

@ -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{}

View File

@ -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 {