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

add support for struct field tags #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add support for struct field tags #51

wants to merge 1 commit into from

Conversation

aerth
Copy link

@aerth aerth commented Dec 17, 2017

With these changes, one can add a struct field tag pretty:"-" to ignore pretty printing a particular field.

For example, the "z" field would not be pretty printed in the following struct

type testFieldTag struct {
	x, y int
	z string `pretty:"-"`
}

Now print long embedded structs prettier

formatter.go Show resolved Hide resolved
formatter.go Outdated Show resolved Hide resolved
formatter_test.go Outdated Show resolved Hide resolved
@aerth aerth force-pushed the master branch 2 times, most recently from 8c0c177 to dae10db Compare December 30, 2020 03:09
@aerth
Copy link
Author

aerth commented Dec 30, 2020

rebased and refactored... added a few test cases. seems to be working good

@NicklasWallgren
Copy link

Can we get this merged?

@sean-
Copy link

sean- commented Nov 3, 2022

Bumping this with a +1. When debugging a library that embeds a very complicated, external data structure, the volume of output from external dependencies can dwarf the local code, making pretty's output more difficult to digest than it needs to be.

@aerth aerth force-pushed the master branch 5 times, most recently from a1b6e35 to 4943660 Compare November 6, 2022 07:30
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

Successfully merging this pull request may close these issues.

None yet

4 participants