-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic when marshalling a struct with a map and a custom MarshalJSON() #12
Comments
It's probably related to the map hiter header copied from the runtime, used to reduce allocations for map ranges. I'll have a look. Can you tell me which version of Go you are using please, and share the unit test you seems to be using ? |
@wI2L It's 1.21 And here's the entire test code:
|
@ziemekobel-ef Found the issue, I'll send a fix for it. |
yes, same error here. import "gorm.io/datatypes"
struct A {
B datatypes.JSONMap // type JSONMap map[string]interface{}
} datatypes.JSONMap is a |
Marshalling panics when a struct containing a map field and a custom MarshalJSON() is provided.
Tested on Apple M1 Pro, running macOS 14.0.
The below test code:
results in:
The text was updated successfully, but these errors were encountered: