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 --- media/docshelper.go | 2 +- media/mediaType.go | 2 +- media/mediaType_test.go | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'media') diff --git a/media/docshelper.go b/media/docshelper.go index de9dbe599..d37c08eb3 100644 --- a/media/docshelper.go +++ b/media/docshelper.go @@ -7,7 +7,7 @@ import ( // This is is just some helpers used to create some JSON used in the Hugo docs. func init() { docsProvider := func() docshelper.DocProvider { - return docshelper.DocProvider{"media": map[string]interface{}{"types": DefaultTypes}} + return docshelper.DocProvider{"media": map[string]any{"types": DefaultTypes}} } docshelper.AddDocProviderFunc(docsProvider) } diff --git a/media/mediaType.go b/media/mediaType.go index 4fceac222..1627a9d52 100644 --- a/media/mediaType.go +++ b/media/mediaType.go @@ -450,7 +450,7 @@ Note that you can still get the Media Type's suffix from a template: {{ $mediaTy // DecodeTypes takes a list of media type configurations and merges those, // in the order given, with the Hugo defaults as the last resort. -func DecodeTypes(mms ...map[string]interface{}) (Types, error) { +func DecodeTypes(mms ...map[string]any) (Types, error) { var m Types // Maps type string to Type. Type string is the full application/svg+xml. diff --git a/media/mediaType_test.go b/media/mediaType_test.go index 2e32568f1..34571f7ee 100644 --- a/media/mediaType_test.go +++ b/media/mediaType_test.go @@ -231,15 +231,15 @@ func TestDecodeTypes(t *testing.T) { tests := []struct { name string - maps []map[string]interface{} + maps []map[string]any shouldError bool assert func(t *testing.T, name string, tt Types) }{ { "Redefine JSON", - []map[string]interface{}{ + []map[string]any{ { - "application/json": map[string]interface{}{ + "application/json": map[string]any{ "suffixes": []string{"jasn"}, }, }, @@ -255,9 +255,9 @@ func TestDecodeTypes(t *testing.T) { }, { "MIME suffix in key, multiple file suffixes, custom delimiter", - []map[string]interface{}{ + []map[string]any{ { - "application/hugo+hg": map[string]interface{}{ + "application/hugo+hg": map[string]any{ "suffixes": []string{"hg1", "hG2"}, "Delimiter": "_", }, @@ -281,9 +281,9 @@ func TestDecodeTypes(t *testing.T) { }, { "Add custom media type", - []map[string]interface{}{ + []map[string]any{ { - "text/hugo+hgo": map[string]interface{}{ + "text/hugo+hgo": map[string]any{ "Suffixes": []string{"hgo2"}, }, }, -- cgit v1.2.3