-
Notifications
You must be signed in to change notification settings - Fork 79
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
Failed to unmarshal valid json #15
Comments
Thanks for the report. |
It looks like it's because the As an easy workaround for now, you can always wrap the actual object in another object. |
Working on the fix_15 branch. |
it cannot properly unmarshall this too: {["this is valid json"]} |
maybe, this way is help to you: func AnyJsonDiff(left interface{}, right interface{}) (gojsondiff.Diff, error) {
type Container struct {
Payload any
}
leftBs, err := json.Marshal(Container{left})
if err != nil {
return nil, err
}
rightBs, err := json.Marshal(Container{right})
if err != nil {
return nil, err
}
return gojsondiff.New().Compare(leftBs, rightBs)
} |
The text was updated successfully, but these errors were encountered: