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 an option to consider nil pointers to be equivalent to zero values #61

Merged
merged 2 commits into from
Jun 23, 2024

Conversation

seveas
Copy link
Contributor

@seveas seveas commented Nov 14, 2023

I have a use-case for go-test/deep that requires me to consider nil and zero values to be equivalent. This PR adds an option + code to achieve this, and tests to verify the behaviour.

Similar to NilSlicesAreEmpty and NilStructsAreEmpty, this lets one
consider nil pointers and zero values as equal.
@SkyN
Copy link

SkyN commented May 21, 2024

good PR! I need this too.

@coveralls
Copy link

Coverage Status

coverage: 99.422% (-0.6%) from 100.0%
when pulling 93c35ac on seveas:nil-pointers-are-zero
into 2982c5c on go-test:master.

@daniel-nichter
Copy link
Member

Sorry for the slow reply. Thanks for the PR. Will release in next version today.

@daniel-nichter daniel-nichter merged commit 47ae1b8 into go-test:master Jun 23, 2024
6 checks passed
@daniel-nichter
Copy link
Member

v1.1.1 pushed.

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

Successfully merging this pull request may close these issues.

4 participants