From b80853de90b10171155b8f3fde47d64ec7bfa0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 17 Mar 2022 22:03:27 +0100 Subject: all: gofmt -w -r 'interface{} -> any' . Updates #9687 --- hugolib/page_test.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'hugolib/page_test.go') diff --git a/hugolib/page_test.go b/hugolib/page_test.go index 926fdb354..d29a4f865 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -298,7 +298,7 @@ func checkPageTitle(t *testing.T, page page.Page, title string) { } } -func checkPageContent(t *testing.T, page page.Page, expected string, msg ...interface{}) { +func checkPageContent(t *testing.T, page page.Page, expected string, msg ...any) { t.Helper() a := normalizeContent(expected) b := normalizeContent(content(page)) @@ -325,7 +325,7 @@ func checkPageTOC(t *testing.T, page page.Page, toc string) { } } -func checkPageSummary(t *testing.T, page page.Page, summary string, msg ...interface{}) { +func checkPageSummary(t *testing.T, page page.Page, summary string, msg ...any) { a := normalizeContent(string(page.Summary())) b := normalizeContent(summary) if a != b { @@ -369,7 +369,7 @@ func normalizeExpected(ext, str string) string { } func testAllMarkdownEnginesForPages(t *testing.T, - assertFunc func(t *testing.T, ext string, pages page.Pages), settings map[string]interface{}, pageSources ...string) { + assertFunc func(t *testing.T, ext string, pages page.Pages), settings map[string]any, pageSources ...string) { engines := []struct { ext string @@ -399,8 +399,8 @@ func testAllMarkdownEnginesForPages(t *testing.T, contentDir = s } - cfg.Set("security", map[string]interface{}{ - "exec": map[string]interface{}{ + cfg.Set("security", map[string]any{ + "exec": map[string]any{ "allow": []string{"^python$", "^rst2html.*", "^asciidoctor$"}, }, }) @@ -572,7 +572,7 @@ func TestCreateNewPage(t *testing.T) { checkPageType(t, p, "page") } - settings := map[string]interface{}{ + settings := map[string]any{ "contentDir": "mycontent", } @@ -697,7 +697,7 @@ func TestPageWithShortCodeInSummary(t *testing.T) { func TestPageWithAdditionalExtension(t *testing.T) { t.Parallel() cfg, fs := newTestCfg() - cfg.Set("markup", map[string]interface{}{ + cfg.Set("markup", map[string]any{ "defaultMarkdownHandler": "blackfriday", // TODO(bep) }) @@ -1039,18 +1039,18 @@ func TestPageWithLastmodFromGitInfo(t *testing.T) { wd, err := os.Getwd() c.Assert(err, qt.IsNil) - cfg.Set("frontmatter", map[string]interface{}{ + cfg.Set("frontmatter", map[string]any{ "lastmod": []string{":git", "lastmod"}, }) cfg.Set("defaultContentLanguage", "en") - langConfig := map[string]interface{}{ - "en": map[string]interface{}{ + langConfig := map[string]any{ + "en": map[string]any{ "weight": 1, "languageName": "English", "contentDir": "content", }, - "nn": map[string]interface{}{ + "nn": map[string]any{ "weight": 2, "languageName": "Nynorsk", "contentDir": "content_nn", @@ -1102,7 +1102,7 @@ lastMod: 2018-02-28 Content ` - cfg.Set("frontmatter", map[string]interface{}{ + cfg.Set("frontmatter", map[string]any{ "date": []string{dateHandler, "date"}, }) @@ -1163,7 +1163,7 @@ func TestWordCountWithAllCJKRunesWithoutHasCJKLanguage(t *testing.T) { func TestWordCountWithAllCJKRunesHasCJKLanguage(t *testing.T) { t.Parallel() - settings := map[string]interface{}{"hasCJKLanguage": true} + settings := map[string]any{"hasCJKLanguage": true} assertFunc := func(t *testing.T, ext string, pages page.Pages) { p := pages[0] @@ -1176,7 +1176,7 @@ func TestWordCountWithAllCJKRunesHasCJKLanguage(t *testing.T) { func TestWordCountWithMainEnglishWithCJKRunes(t *testing.T) { t.Parallel() - settings := map[string]interface{}{"hasCJKLanguage": true} + settings := map[string]any{"hasCJKLanguage": true} assertFunc := func(t *testing.T, ext string, pages page.Pages) { p := pages[0] @@ -1195,7 +1195,7 @@ func TestWordCountWithMainEnglishWithCJKRunes(t *testing.T) { func TestWordCountWithIsCJKLanguageFalse(t *testing.T) { t.Parallel() - settings := map[string]interface{}{ + settings := map[string]any{ "hasCJKLanguage": true, } -- cgit v1.2.3