litter 优雅打印结构体
最后更新于:2022-04-02 02:39:26
[TOC]
> [github](https://github.com/sanity-io/litter)
## 安装
`go get -u github.com/sanity-io/litter`
## 使用
```
type Person struct {
Name string
Age int
Parent *Person
}
litter.Dump(Person{
Name: "Bob",
Age: 20,
Parent: &Person{
Name: "Jane",
Age: 50,
},
})
//输出
main.Person{
Name: "Bob",
Age: 20,
Parent: &main.Person{
Name: "Jane",
Age: 50,
Parent: nil,
},
}
```
';