mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 13:22:09 +08:00
Merge 82e61fd9ddfc2fac9004ccaa476d078da70637a8 into d4a64265f21993368c90602c18e778bf04ef36db
This commit is contained in:
commit
1a8c122d67
@ -62,8 +62,8 @@ func (msg *Error) JSON() any {
|
||||
case reflect.Struct:
|
||||
return msg.Meta
|
||||
case reflect.Map:
|
||||
for _, key := range value.MapKeys() {
|
||||
jsonData[key.String()] = value.MapIndex(key).Interface()
|
||||
for iter := value.MapRange(); iter.Next(); {
|
||||
jsonData[iter.Key().String()] = iter.Value().Interface()
|
||||
}
|
||||
default:
|
||||
jsonData["meta"] = msg.Meta
|
||||
|
Loading…
x
Reference in New Issue
Block a user