all: gofmt -w -r 'interface{} -> any' .

Updates #9687
This commit is contained in:
Bjørn Erik Pedersen
2022-03-17 22:03:27 +01:00
parent 423594e03a
commit b80853de90
342 changed files with 2118 additions and 2102 deletions

View File

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

View File

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

View File

@@ -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"},
},
},