# 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
相关推荐
CappuccinoRose3 小时前
JSON 数据交互规范福大大架构师每日一题7 小时前
ragflow v0.27.0 发布:Go 后端全面对齐、智能体搜索与知识编译大升级,超全更新解析JavaPub-rodert7 小时前
Go 后台如何同时兼容 MySQL、PostgreSQL、SQLite 和 SQL Server?从 ShiyuAdmin 看 GORM 多数据库适配剩下了什么21 小时前
float32 与 float64 精度陷阱:如何在 Go 中避免错误使用不会代码的小猴1 天前
7. JSONttwuai1 天前
Go 后台接入 SSO 后菜单正常但接口 403,怎么排查权限链路?PC2005-cloud1 天前
Go学习笔记:基本概念与项目结构——GOPATH、Go Modules 与常用命令ttwuai1 天前
Go 后台图片上传到对象存储后,预览 403/404 怎么排查?丰锋ff1 天前
7.1Json名字还没想好☜1 天前
Go 1.23 range-over-func 迭代器实战:自定义可迭代类型、提前退出与惰性求值