goutil
goutil copied to clipboard
Dump: Can dump provide a parameter to control nil/zero not to print?
Example:
type T1 struct {
T2 *T2
T3 *T3
}
type T2 struct {
Name2 string
}
type T3 struct {
Name3 string
}
func main() {
t1 := &T1{
T2: &T2{
Name2: "xx",
},
}
dump.P(t1)
}
output:
PRINT AT main.main(main.go:27)
&main.T1 {
T2: &main.T2 {
Name2: string("xx"), #len=2
},
T3: *main.T3<nil>,
}
i want to ignore T3: *main.T3<nil>
hi @lx-world
Why do you need this setting?
add new option: SkipNilField, will release at next version.