# 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
相关推荐
wuyk55510 小时前
Spider-第07讲-JSON接口与正则提取程序员Query13 小时前
day01-认识Go语言 + golang环境的安装喵了几个咪2 天前
GoWind Flow 拆解:一个 Go 工作流引擎与它的双模式设计器codeejun2 天前
每日一Go·MySQL-14、慢 SQL 产生原因全解xbzb3 天前
镜像到底存在哪:/var/lib/docker 的四级映射与 daemon.json 配置坤坤子吖3 天前
Linux网络编程:自定义应用层协议与 JSON 序列化code2cat4 天前
【随笔】结构化输出:JSON格式过关,业务数据就能入库吗利威尔xu4 天前
Go map 底层崩溃:3 个 goroutine 并发写同一张 map,fatal error 崩掉整个服务利威尔xu6 天前
2026-11-08-Go-defer-panic-recover面试JWASX6 天前
【Go】map 源码解析 - group