代码拉取完成,页面将自动刷新
本库修改自https://github.com/shurcooL/goon, 由于上面的库常久不更新, 并且我需要做一些小的修改满足需求, 所以fork了自用, 仍采用MIT许可.
主要修改有:
Package goon is a deep pretty printer with Go-like notation. It implements the goon specification.
go get -u github.com/shurcooL/go-goon
x := Lang{
Name: "Go",
Year: 2009,
URL: "http",
Inner: &Inner{
Field1: "Secret!",
},
}
goon.Dump(x)
// Output:
// (Lang)(Lang{
// Name: (string)("Go"),
// Year: (int)(2009),
// URL: (string)("http"),
// Inner: (*Inner)(&Inner{
// Field1: (string)("Secret!"),
// Field2: (int)(0),
// }),
// })
items := []int{1, 2, 3}
goon.DumpExpr(len(items))
// Output:
// len(items) = (int)(3)
adderFunc := func(a int, b int) int {
c := a + b
return c
}
goon.DumpExpr(adderFunc)
// Output:
// adderFunc = (func(int, int) int)(func(a int, b int) int {
// c := a + b
// return c
// })
Path | Synopsis |
---|---|
bypass | Package bypass allows bypassing reflect restrictions on accessing unexported struct fields. |
go-goon source was based on the existing source of go-spew by Dave Collins.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。