aboutsummaryrefslogtreecommitdiffhomepage
path: root/media
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-03-17 22:03:27 +0100
committerBjørn Erik Pedersen <[email protected]>2022-03-17 22:03:27 +0100
commitb80853de90b10171155b8f3fde47d64ec7bfa0dd (patch)
tree435d3dbf7a495a0c6ce64c9769e037179aa0d27b /media
parent423594e03a906ef4150f433666ff588b022c3c92 (diff)
downloadhugo-b80853de90b10171155b8f3fde47d64ec7bfa0dd.tar.gz
hugo-b80853de90b10171155b8f3fde47d64ec7bfa0dd.zip
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'media')
-rw-r--r--media/docshelper.go2
-rw-r--r--media/mediaType.go2
-rw-r--r--media/mediaType_test.go14
3 files changed, 9 insertions, 9 deletions
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"},
},
},