# 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
相关推荐
九英里路1 小时前
protobuf快速上手wuyk55514 小时前
Spider-第09讲-三格式落盘CSV-Excel-JSONwuyk5551 天前
Spider-第07讲-JSON接口与正则提取程序员Query2 天前
day01-认识Go语言 + golang环境的安装喵了几个咪3 天前
GoWind Flow 拆解:一个 Go 工作流引擎与它的双模式设计器codeejun3 天前
每日一Go·MySQL-14、慢 SQL 产生原因全解xbzb4 天前
镜像到底存在哪:/var/lib/docker 的四级映射与 daemon.json 配置坤坤子吖4 天前
Linux网络编程:自定义应用层协议与 JSON 序列化code2cat5 天前
【随笔】结构化输出:JSON格式过关,业务数据就能入库吗利威尔xu6 天前
Go map 底层崩溃:3 个 goroutine 并发写同一张 map,fatal error 崩掉整个服务