go json格式化输出到文件
-
code
//docsMaps json对象 file, _ := os.Create("file.txt") b, _ := json.Marshal(docsMaps) var out bytes2.Buffer _ = json.Indent(&out, b, "", "\t")
code
//docsMaps json对象
file, _ := os.Create("file.txt")
b, _ := json.Marshal(docsMaps)
var out bytes2.Buffer
_ = json.Indent(&out, b, "", "\t")
本文标题:go json格式化输出到文件
本文链接:https://www.haomeiwen.com/subject/iuugxltx.html
网友评论