# 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
相关推荐
techdashen8 小时前
Go Map 详解:键值对实际上是如何存储的ttwuai13 小时前
Go 后台初始化 MySQL 脚本失败怎么办?先查 DDL 还是生成配置名字还没想好☜13 小时前
Go 的 TCP 粘包与拆包:用长度前缀协议 + bufio 正确读消息王的宝库1 天前
Go 项目结构:从单文件到标准工程布局花酒锄作田1 天前
Go - Gin中使用sessions不甘先生1 天前
Go 中 type、方法与指针接收者:从 str_name.Name() 看懂 Go 的类型系统谢斯1 天前
[unity]如何在unity中添加newtonsoft-jsonCasbin开源社区1 天前
一个面板管住 29 个 AI 编程 Agent:Casbin Gateway 的配置统一、协议互转、用量统计与权限管控名字还没想好☜2 天前
Go 标准库 flag 包实战:参数解析、子命令、自定义 Value 类型与默认值zh73142 天前
Go 1.23 → 1.26 升级检查文档