Skip to content
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

获取商品接口报错 #20

Open
zacklpx opened this issue Jun 9, 2021 · 3 comments
Open

获取商品接口报错 #20

zacklpx opened this issue Jun 9, 2021 · 3 comments

Comments

@zacklpx
Copy link

zacklpx commented Jun 9, 2021

IsVideo *string `json:"is_video,omitempty"`

请求获取商品会报错:
json: cannot unmarshal bool into Go struct field ProductItemsGetListStruct.data.list.is_video of type string

is_video是string类型,结果返回bool类型解析失败

@KylinHuang7
Copy link
Contributor

能否从日志里拿到接口返回的trace_id,我们好排查一下

@zacklpx
Copy link
Author

zacklpx commented Jun 10, 2021

能否从日志里拿到接口返回的trace_id,我们好排查一下

没人trace_id的,http请求返回的结果是正常的,只是对返回的json结果解析时因为类型错误导致解析失败报错

@zacklpx
Copy link
Author

zacklpx commented Jun 10, 2021

Fields: optional.NewInterface([]string{"product_outer_id", "product_name", "product_image_url"}),

example代码,这里指定返回参数字段列表添加"is_video"即可重现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants