mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
all: Run modernize -fix ./...
This commit is contained in:
@@ -99,7 +99,7 @@ func (c ReplacingJSONMarshaller) MarshalJSON() ([]byte, error) {
|
||||
|
||||
if c.OmitEmpty {
|
||||
// It's tricky to do this with a regexp, so convert it to a map, remove zero values and convert back.
|
||||
var m map[string]interface{}
|
||||
var m map[string]any
|
||||
err = json.Unmarshal(converted, &m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -111,9 +111,9 @@ func (c ReplacingJSONMarshaller) MarshalJSON() ([]byte, error) {
|
||||
delete(m, k)
|
||||
} else {
|
||||
switch vv := v.(type) {
|
||||
case map[string]interface{}:
|
||||
case map[string]any:
|
||||
removeZeroVAlues(vv)
|
||||
case []interface{}:
|
||||
case []any:
|
||||
for _, vvv := range vv {
|
||||
if m, ok := vvv.(map[string]any); ok {
|
||||
removeZeroVAlues(m)
|
||||
|
Reference in New Issue
Block a user