weixin icon indicating copy to clipboard operation
weixin copied to clipboard

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

Open qianlongzt opened this issue 7 years ago • 0 comments

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

https://github.com/wizjin/weixin/blob/e9f0f2024d5d22e4e56b15c1d884da57fc0b7122/weixin.go#L763-L768

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

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

qianlongzt avatar Sep 05 '18 07:09 qianlongzt