golang pretty-print json

复制代码
# struct use  MarshalIndent
dataByte, err := json.MarshalIndent(v, "", "    ")
	
# str json use gjson @pretty
gjson.Get(task.Config, "@pretty").String()
相关推荐
利威尔xu14 小时前
Go defer 十连问:LIFO 顺序答错参数求值时机,3 处资源泄漏拖垮服务
开发语言·golang·defer·recover·panic
SEO_juper15 小时前
Node.js Product 结构化数据生成器:给产品页一键生成 JSON-LD
开发语言·前端·javascript·人工智能·node.js·json·1024程序员节
熊猫钓鱼>_>1 天前
Java处理JSON编程实用技巧
json
NendoZen1 天前
Bubble Tea V2构建Go TUI应用教程
开发语言·golang·xcode
pan_junbiao1 天前
Go 语言变量的声明与初始化
开发语言·javascript·golang
pan_junbiao2 天前
Go 语言基本数据类型
java·前端·golang
Thanks_ks2 天前
提示词工程实战:用结构化提示词让大模型输出稳定可控
python·大模型·json·openai·提示词工程·deepseek·系统提示词
codeejun2 天前
每日一Go·MySQL-24、死锁排查与解决方案
开发语言·mysql·golang
SEO_juper2 天前
HTTPS 混合内容检查工具:页面全站 https 了,但还有 http 资源在拖后腿
开发语言·网络协议·http·https·node.js·json·bash
利威尔xu2 天前
Go context取消传播3层:信号传不到第3层goroutine,泄漏拖垮
后端·golang