We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我在一个复杂的struct中,如果使用了除golang自带类型之外,就会没办法提前初始化变量,而sonic又会自动去反射调用对应库的marshaljson和unmarshaljson,这个时候就会出错(因为不是每一个第三方库都只需要实例化结构体就行,里面会有很多不暴露的属性需要初始化),所以建议添加一个接口或函数,比如withInitFuncs,由用户传递一个sonic在反序列化过程中发现字段为nil的时候,先调用初始化函数,再调用unmarshaljson函数。谢谢
The text was updated successfully, but these errors were encountered:
obj不是你传给sonic的么?为啥不能在调用unmarshal之前先设置好没理解
Sorry, something went wrong.
No branches or pull requests
我在一个复杂的struct中,如果使用了除golang自带类型之外,就会没办法提前初始化变量,而sonic又会自动去反射调用对应库的marshaljson和unmarshaljson,这个时候就会出错(因为不是每一个第三方库都只需要实例化结构体就行,里面会有很多不暴露的属性需要初始化),所以建议添加一个接口或函数,比如withInitFuncs,由用户传递一个sonic在反序列化过程中发现字段为nil的时候,先调用初始化函数,再调用unmarshaljson函数。谢谢
The text was updated successfully, but these errors were encountered: