m :=map[string]string{"type":"10","msg":"hello."}
mjson,_ :=json.Marshal(m)
mString :=string(mjson)
fmt.Printf("print mString:%s",mString)
此博客聚焦于Golang中map转JSON字符串的内容,在信息技术领域,Golang是常用后端开发语言,map转JSON字符串是常见操作,对数据处理和传输有重要意义。
m :=map[string]string{"type":"10","msg":"hello."}
mjson,_ :=json.Marshal(m)
mString :=string(mjson)
fmt.Printf("print mString:%s",mString)
1307

被折叠的 条评论
为什么被折叠?