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

发送模板消息出现 json: cannot unmarshal number into Go struct field .msgid of type int32 错误 #33

Open
qianlongzt opened this issue Sep 5, 2018 · 0 comments

Comments

@qianlongzt
Copy link

完整信息 json: cannot unmarshal number 445263598701395969 into Go struct field .msgid of type int32

weixin/weixin.go

Lines 763 to 768 in e9f0f20

var resp struct {
MsgID int64 `json:"msgid,omitempty"`
}
if err := json.Unmarshal(reply, &resp); err != nil {
return 0, err
}

原因在于int32 不能包含 445263598701395969 ,它也比较解决 int64 的最大值

https://golang.org/pkg/encoding/json/#Number 可能是最后的解决方案

@BillSJC BillSJC mentioned this issue Feb 29, 2020
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

1 participant