# 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
相关推荐
~|Bernard|6 小时前
四,go语言中GMP调度模型Kiyra6 小时前
LLM 的 JSON 不靠谱:结构化输出的重试与修复实战littleschemer8 小时前
Go 手动挡元编程:go:generate 实战解析平凡但不平庸的码农8 小时前
Go GMP 调度模型详解易生一世9 小时前
JWT详解2501_931803751 天前
Go:一门为解决C语言痛点而生的现代语言geovindu1 天前
go: Interpreter Pattern平凡但不平庸的码农1 天前
Go Channel详解子安柠1 天前
深入理解 Go 语言文件操作:从基础到最佳实践Achou.Wang1 天前
go语言中使用等待组(waitgroups)和内存屏障(barriers)进行同步