Skip to content

Commit

Permalink
Run gofmt -s
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Oct 23, 2018
1 parent e3ed4a8 commit 889aca0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 24 deletions.
4 changes: 2 additions & 2 deletions hugolib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,12 @@ func applyThemeConfig(v1 *viper.Viper, theme paths.ThemeConfig) error {
// Only add params and new menu entries, we do not add language definitions.
if v1.IsSet(languagesKey) && v2.IsSet(languagesKey) {
v1Langs := v1.GetStringMap(languagesKey)
for k, _ := range v1Langs {
for k := range v1Langs {
langParamsKey := languagesKey + "." + k + "." + paramsKey
mergeStringMapKeepLeft(paramsKey, langParamsKey, v1, v2)
}
v2Langs := v2.GetStringMap(languagesKey)
for k, _ := range v2Langs {
for k := range v2Langs {
if k == "" {
continue
}
Expand Down
8 changes: 4 additions & 4 deletions hugolib/pagemeta/page_frontmatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ type FrontMatterDescriptor struct {

var (
dateFieldAliases = map[string][]string{
fmDate: []string{},
fmLastmod: []string{"modified"},
fmPubDate: []string{"pubdate", "published"},
fmExpiryDate: []string{"unpublishdate"},
fmDate: {},
fmLastmod: {"modified"},
fmPubDate: {"pubdate", "published"},
fmExpiryDate: {"unpublishdate"},
}
)

Expand Down
18 changes: 9 additions & 9 deletions hugolib/site_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ func createDefaultOutputFormats(allFormats output.Formats, cfg config.Provider)
sitemapOut, _ := allFormats.GetByName(output.SitemapFormat.Name)

return map[string]output.Formats{
KindPage: output.Formats{htmlOut},
KindHome: output.Formats{htmlOut, rssOut},
KindSection: output.Formats{htmlOut, rssOut},
KindTaxonomy: output.Formats{htmlOut, rssOut},
KindTaxonomyTerm: output.Formats{htmlOut, rssOut},
KindPage: {htmlOut},
KindHome: {htmlOut, rssOut},
KindSection: {htmlOut, rssOut},
KindTaxonomy: {htmlOut, rssOut},
KindTaxonomyTerm: {htmlOut, rssOut},
// Below are for conistency. They are currently not used during rendering.
kindRSS: output.Formats{rssOut},
kindSitemap: output.Formats{sitemapOut},
kindRobotsTXT: output.Formats{robotsOut},
kind404: output.Formats{htmlOut},
kindRSS: {rssOut},
kindSitemap: {sitemapOut},
kindRobotsTXT: {robotsOut},
kind404: {htmlOut},
}

}
Expand Down
2 changes: 0 additions & 2 deletions hugolib/testhelpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import (
"github.com/stretchr/testify/require"
)

const ()

type sitesBuilder struct {
Cfg config.Provider
Fs *hugofs.Fs
Expand Down
12 changes: 6 additions & 6 deletions tpl/collections/collections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ func TestGroup(t *testing.T) {
items interface{}
expect interface{}
}{
{"a", []*tstGrouper{&tstGrouper{}, &tstGrouper{}}, "a(2)"},
{"a", []*tstGrouper{{}, {}}, "a(2)"},
{"b", tstGroupers{&tstGrouper{}, &tstGrouper{}}, "b(2)"},
{"a", []tstGrouper{tstGrouper{}, tstGrouper{}}, "a(2)"},
{"a", []*tstGrouper2{&tstGrouper2{}, &tstGrouper2{}}, "a(2)"},
{"b", []tstGrouper2{tstGrouper2{}, tstGrouper2{}}, "b(2)"},
{"a", []tstGrouper{{}, {}}, "a(2)"},
{"a", []*tstGrouper2{{}, {}}, "a(2)"},
{"b", []tstGrouper2{{}, {}}, "b(2)"},
{"a", []*tstGrouper{}, "a(0)"},
{"a", []string{"a", "b"}, false},
{"a", "asdf", false},
{"a", nil, false},
{nil, []*tstGrouper{&tstGrouper{}, &tstGrouper{}}, false},
{nil, []*tstGrouper{{}, {}}, false},
} {
errMsg := fmt.Sprintf("[%d] %v", i, test)

Expand Down Expand Up @@ -654,7 +654,7 @@ func TestSlice(t *testing.T) {
{[]interface{}{}, []interface{}{}},
{[]interface{}{nil}, []interface{}{nil}},
{[]interface{}{5, "b"}, []interface{}{5, "b"}},
{[]interface{}{tstNoStringer{}}, []tstNoStringer{tstNoStringer{}}},
{[]interface{}{tstNoStringer{}}, []tstNoStringer{{}}},
} {
errMsg := fmt.Sprintf("[%d] %v", i, test.args)

Expand Down
2 changes: 1 addition & 1 deletion tpl/tplimpl/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ func (t *templateHandler) addTemplateFile(name, baseTemplatePath, path string) e
}

var embeddedTemplatesAliases = map[string][]string{
"shortcodes/twitter.html": []string{"shortcodes/tweet.html"},
"shortcodes/twitter.html": {"shortcodes/tweet.html"},
}

func (t *templateHandler) loadEmbedded() error {
Expand Down

0 comments on commit 889aca0

Please sign in to comment.