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

Added ability to ignore fields by tagging them. #12

Merged
merged 4 commits into from
Aug 7, 2017

Conversation

mikijov
Copy link
Contributor

@mikijov mikijov commented Jul 14, 2017

Added code and tests to support tagging fields with testdiff:"ignore".
Adding this tag to any field will make messagediff skip this field.
This is useful for transient fields that do not store actual value of
the struct. I have used generic 'testdiff' tag to potentially make it
usable by other libraries who might want to do the same purpose.

Added code and tests to support tagging fields with testdiff:"ignore".
Adding this tag to any field will make messagediff skip this field.
This is useful for transient fields that do not store actual value of
the struct. I have used generic 'testdiff' tag to potentially make it
usable by other libraries who might want to do the same purpose.
@coveralls
Copy link

coveralls commented Jul 14, 2017

Coverage Status

Coverage increased (+0.07%) to 91.63% when pulling a03042f on mikijov:ignore-by-tag into 080993f on d4l3k:master.

Copy link
Owner

@d4l3k d4l3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

README.md Outdated
a := someStruct{1, 2, []int{1}}
b := someStruct{1, 3, []int{1, 2}}
a := someStruct{1, 2, []int{1}, 9}
b := someStruct{1, 3, []int{1, 2}, 10}
Copy link
Owner

@d4l3k d4l3k Jul 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should add as a separate example to show off this feature since most people won't care about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to create a new test case, or to create a new Test with it's own struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I separated the test for ignoring fields into a separate test altogether.

@coveralls
Copy link

coveralls commented Jul 17, 2017

Coverage Status

Coverage increased (+0.07%) to 91.63% when pulling 53727f2 on mikijov:ignore-by-tag into 080993f on d4l3k:master.

@coveralls
Copy link

coveralls commented Jul 18, 2017

Coverage Status

Coverage increased (+0.07%) to 91.63% when pulling 80179b6 on mikijov:ignore-by-tag into 080993f on d4l3k:master.

@mikijov
Copy link
Contributor Author

mikijov commented Jul 18, 2017

I mistakenly thought your review comment related to actual tests and not README... I fixed it in docs now. I also corrected indentation of the code in README.

@coveralls
Copy link

coveralls commented Jul 18, 2017

Coverage Status

Coverage increased (+0.07%) to 91.63% when pulling 98fabf1 on mikijov:ignore-by-tag into 080993f on d4l3k:master.

@d4l3k d4l3k merged commit 29f32d8 into d4l3k:master Aug 7, 2017
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

3 participants