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

features suggestions #86

Open
mpup371 opened this issue Apr 25, 2024 · 1 comment
Open

features suggestions #86

mpup371 opened this issue Apr 25, 2024 · 1 comment

Comments

@mpup371
Copy link

mpup371 commented Apr 25, 2024

hi,
I started to use this nice lib.
It would be nice to have a function :
func (pp *PrettyPrinter) SetMaxDepth(depth int) {
pp.maxDepth = depth
}
so that we can build different printers with different depths.
It would be nice too to have an option to force the representation of some kinds of variables, like force []byte to string.
or even time.Time to string instead of going deeper ?
cheers
jf

@k0kubun
Copy link
Owner

k0kubun commented Apr 27, 2024

Sounds good. Could put the definition around

pp/pp.go

Lines 140 to 154 in 6f55b4d

func (pp *PrettyPrinter) SetColoringEnabled(enabled bool) {
pp.coloringEnabled = enabled
}
func (pp *PrettyPrinter) SetDecimalUint(enabled bool) {
pp.decimalUint = enabled
}
func (pp *PrettyPrinter) SetExportedOnly(enabled bool) {
pp.exportedOnly = enabled
}
func (pp *PrettyPrinter) SetThousandsSeparator(enabled bool) {
pp.thousandsSeparator = enabled
}
in a pull request?

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

No branches or pull requests

2 participants