Merge 82e61fd9ddfc2fac9004ccaa476d078da70637a8 into d4a64265f21993368c90602c18e778bf04ef36db

This commit is contained in:
korzhao 2023-07-20 07:02:45 +00:00 committed by GitHub
commit 1a8c122d67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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