golang pretty-print json

复制代码
# struct use  MarshalIndent
dataByte, err := json.MarshalIndent(v, "", "    ")
	
# str json use gjson @pretty
gjson.Get(task.Config, "@pretty").String()
相关推荐
Java展博3 小时前
[Go 后端转场] 从 try-catch 到 if err != nil:写惯 Java 的人第一次上手最别扭的 4 件事
java·开发语言·golang
用户298698530146 小时前
在 Python 中把 Word 文档转换为 JSON 的三种实现方式
python·json·api
联犀1 天前
ai时代复杂项目的golang项目如何更好的与ai共舞:monorepo+gozero
开发语言·人工智能·golang
codeejun1 天前
每日一Go·MySQL-15、慢查询日志实战分析(从 0 到 1 实战排查慢 SQL)
sql·mysql·golang
FRing032 天前
vue2干货总结10(json-server、vant-ui、postcss插件、axios二次封装、图形验证码、toast轻提示)
开发语言·前端·vue.js·ui·json·vue2·postcss
用户298698530142 天前
使用 Python 将 JSON 转换为 Word 文档的实践指南
python·json·api
九英里路3 天前
protobuf快速上手
网络·c++·中间件·json·谷歌·序列化·protobuf
wuyk5553 天前
Spider-第09讲-三格式落盘CSV-Excel-JSON
爬虫·python·json·excel
wuyk5554 天前
Spider-第07讲-JSON接口与正则提取
爬虫·python·json
程序员Query4 天前
day01-认识Go语言 + golang环境的安装
开发语言·后端·golang