-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
util/gutil: gconv struct to map bug, omitempty
takes no effect
#3721
Comments
这个时候还是用json标签把 |
At this time it is better to use json tags |
这个和json没有关系,之所以结果是json是因为使用了g.Dump把map转换为了json。 |
This has nothing to do with json. The reason why the result is json is because g.Dump is used to convert map to json. |
omitempty
take no effect
omitempty
take no effectomitempty
takes no effect
我看了一下这个gconv.Map 是有option参数的,比如:
设置参数以后输出的结果就是下面的样子,我不知道这是不是属于特性
|
I took a look and this gconv.Map has option parameters, such as:
After setting the parameters, the output result is as follows. I don’t know if this is a feature.
|
看样子必须使用option选项才行
|
It seems that you must use the option option.
|
这是官方的案例
https://goframe.org/pages/viewpage.action?pageId=1114356
下面案例中,理论上nickname不应该出现在输出结果中
同样的案例,使用mapstructure库测试是没有问题的
输出
The text was updated successfully, but these errors were encountered: