map转为json

5年以前  |  阅读数:498 次  |  编程语言:Golang 
m :=map[string]string{"type":"10","msg":"hello."}
mjson,_ :=json.Marshal(m)
mString :=string(mjson)
fmt.Printf("print mString:%s",mString)

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8