Dump: Can dump provide a parameter to control nil/zero not to print?

This issue has been created since 2022-03-30.

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>

inhere wrote this answer on 2022-04-08

hi @lx-world

Why do you need this setting?

inhere wrote this answer on 2022-12-12

add new option: SkipNilField, will release at next version.

More Details About Repo
Owner Name gookit
Repo Name goutil
Full Name gookit/goutil
Language Go
Created Date 2018-07-03
Updated Date 2023-03-22
Star Count 1263
Watcher Count 29
Fork Count 142
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Support for returnObjects 1 2022-01-31 2023-02-15
Not able to use the script 4 2022-10-20 2023-02-11
gradient color for dark/white mode 1 2022-11-11 2023-01-29
Correlation.py and event_detail.py script 1 2021-02-11 2023-03-11
请问底部的留白应该怎么控制 2 2021-11-18 2022-01-23
UnifiedPush: Rate limiting issues with matrix.gateway.unifiedpush.org and up.schildi.chat 8 2022-02-14 2023-02-14
[BUG] Cannot disable the glossary and/or symbols 4 2021-04-07 2023-02-28
Add GPU/CUDA support in Docker image 0 2022-07-18 2023-03-11
Error in run_enrichment. feature.sets has to be a list or a binary matrix. 0 2022-05-24 2023-03-11
LangServer crashes often (at "AddMissingFunKeyword") 4 2022-09-26 2023-02-07
Is this project still active? 1 2021-01-07 2022-09-06
uthash 版本适配 1 2021-09-16 2022-01-08
a problem about class QNetwork 0 2021-08-11 2023-03-03
ValueError: too many values to unpack 1 2021-08-12 2023-03-03
a little error 1 2021-08-12 2021-11-11
Could PPO solve DM control tasks? 0 2021-06-29 2023-03-03
Mismatch while converting to epoch time 0 2022-12-13 2023-03-11
Too many errors, I don't understand what to do, help appreciated! 4 2021-09-20 2023-03-17
[BUG] Open file location some times breaks 1 2021-09-24 2022-08-10
Folder quality should reflect files' quality if consistent across album, otherwise it causes RSS to upgrade albums that already meet cut-off criteria 0 2022-11-02 2023-03-14
"Yank game pak" causes memory leak and maxed cpu core use 0 2022-04-02 2023-03-09
Enable variables for buffer only 1 2019-11-29 2023-01-29
[chocolatey] Add a skipChocolatey property 0 2021-12-22 2023-02-16
[IDEA] раньше было лучше 1 2021-12-07 2023-01-29
[check_swatinit] PPCWMAX flagging is buggy 1 2021-04-28 2023-02-28
Error on https://games.crazygames.com/en_US/electric-man/index.html 1 2021-11-04 2023-03-11
SmartModule CRD and distribution 0 2021-10-13 2023-02-07
When switching events, vector fire points seem to get highlighted 0 2021-07-16 2023-03-20
Visual Studio Code Web Extension 0 2021-09-07 2021-10-05
Show images of selected connector types in forms 1 2022-01-11 2023-02-24
WizardGenerator: Support for cross-referencing of input Field values 1 2021-09-21 2021-11-08
TypeError: theme.spacing is not a function 3 2021-10-08 2022-12-23
Add documentation for validating webhook 4 2022-04-29 2023-02-27
Progress on docker push command 1 2021-11-09 2023-03-02
404 at /docker-for-linux/troubleshoot 2 2021-11-09 2023-03-10
x/build/cmd/coordinator: exceeding Gerrit tree fetch limit should be a fatal error 1 2021-11-21 2023-01-06
Can't set fill and colour on geom_sf when thematic is on 0 2022-12-13 2023-03-07
StaggeredGridLayoutHelper顶部空白一节 1 2020-05-06 2023-03-08
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. 1 2022-06-24 2023-03-16
support MPEG-2 layer 3 codec ID 4 2021-02-09 2023-03-18
[benchmarks] Regression detected 2 2022-02-02 2023-01-02
Replace usage of `text/template` script with `template` element 8 2023-02-06 2023-02-17
Fix bintray package name 0 2018-01-31 2023-01-23
Electricity Price two hours old, should be current price 4 2022-10-19 2023-01-21
[Feature Request] Ability to load libraries dynamically from remote server 6 2023-02-03 2023-03-05
liquibase-plugin dropAll Warns with Cannot Drop Collection Database Change Log as not found 1 2021-03-23 2023-02-23
Files with spaces are not linked properly. 1 2021-10-21 2023-01-29
Potential Bug in DataFlowCreateJavaJobOperator 2 2022-03-04 2022-08-19
Frozen Fields snowflake doesn't load Anki 2.0 0 2019-03-12 2023-01-29
solcjs should issue an error if using an unsupported commandline option 0 2018-01-04 2023-02-11