Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lx-world opened this issue Mar 30, 2022 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@lx-world
Copy link

lx-world commented Mar 30, 2022

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>

@lx-world lx-world changed the title Can Dump provide a charging parameter nil/zero? [Dump]: Can Dump provide a charging parameter nil/zero? Mar 30, 2022
@lx-world lx-world changed the title [Dump]: Can Dump provide a charging parameter nil/zero? Dump: Can Dump provide a charging parameter nil/zero? Mar 30, 2022
@lx-world lx-world changed the title Dump: Can Dump provide a charging parameter nil/zero? Dump: Can dump provide a parameter to control nil/zero not to print? Mar 30, 2022
@inhere inhere self-assigned this Mar 30, 2022
@inhere
Copy link
Member

inhere commented Apr 8, 2022

hi @lx-world

Why do you need this setting?

@inhere inhere added enhancement New feature or request and removed suggestion labels Dec 10, 2022
@inhere inhere closed this as completed in a55c5ca Dec 12, 2022
@inhere
Copy link
Member

inhere commented Dec 12, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants