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

Use reflect.Value.Pointer() to compare pointers #1296

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlexanderYastrebov
Copy link

Summary

Use reflect.Value.Pointer() to compare pointers

Changes

Updates samePointers implementation and adds test cases

Motivation

This is needed to check if map, slice and other built-in types point to the same value

Related issues

Fixes #1076

Copy link

@stevenh stevenh left a comment

Choose a reason for hiding this comment

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

LGTM

assert/assertions.go Outdated Show resolved Hide resolved
assert/assertions.go Outdated Show resolved Hide resolved
@dolmen dolmen added enhancement pkg-assert Change related to package testify/assert internal/refactor Refactor internals with no external visible changes assert.EqualValues About equality Changes Requested labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert.EqualValues About equality enhancement internal/refactor Refactor internals with no external visible changes pkg-assert Change related to package testify/assert
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assert equal pointers
4 participants