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
tlpdata:= map[string]struct { value string color string }{"first": {value: "我是渣渣涛", color: "#173177"}, "keyword1": {value: "这是一个你从没有玩过的全新游戏", color: "#173177"}, "keyword2": {value: "只要你跟着我一起试玩一下", color: "#173177"}, "keyword3": {value: "你就会爱上这款游戏", color: "#4B1515"}, "remark": {value: "是兄弟就来砍我", color: "#071D42"}, } msgid,_ := ctx.SendTemplate( ctx.Msg.FromUserName, "tempid", c.Request.Host, ctx.AppId, "", tlpdata, )
The text was updated successfully, but these errors were encountered:
由于go语言json解析的特殊性,需要大写字段才能导出,struct结构可改为如下方式:
tlpdata := map[string]struct { Value string `json:"value"` Color string `json:"color"` }{ "first": {Value: "我是渣渣涛", Color: "#173177"}, "keyword1": {Value: "这是一个你从没有玩过的全新游戏", Color: "#173177"}, "keyword2": {Value: "只要你跟着我一起试玩一下", Color: "#173177"}, "keyword3": {Value: "你就会爱上这款游戏", Color: "#4B1515"}, "remark": {Value: "是兄弟就来砍我", Color: "#071D42"}, }
Sorry, something went wrong.
太久没玩go了,你一说我突然就想起来了.感谢感谢
No branches or pull requests
代码如下
效果如下
The text was updated successfully, but these errors were encountered: