# struct use MarshalIndent
dataByte, err := json.MarshalIndent(v, "", " ")
# str json use gjson @pretty
gjson.Get(task.Config, "@pretty").String()
golang pretty-print json
Beer Home2024-07-27 13:03
相关推荐
apocelipes1 天前
常用编程语言和库的正则表达式性能对比Venuslite5 天前
从 Unexpected token < 到 Extra data:一次讲清 JSON 解析错误的排查思路疯狂SQL11 天前
手写高性能在线 JSON 工具|Web Worker 工程化打包 + 语法自动修复 + 多语言代码生成实战何以解忧,唯有..16 天前
Go语言循环语句详解:for、range与循环控制踏着七彩祥云的小丑16 天前
Go学习第9天:并发编程 + 文件操作 + 正则表达式JCGKS16 天前
Go `init` 函数:包初始化顺序到底是怎样的何以解忧,唯有..16 天前
Go语言中的const:常量声明与iota枚举详解terry60016 天前
5G视频短信服务商选型全攻略:通道资源、架构能力与成本评估2026最新标准geovindu16 天前
go: Reactor Pattern