Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
assert.Equalreporting distinct atomic pointers to equal values as unequal.Changes
sync/atomic.Pointertype, preserving nil and pointer-identity behavior.Loadmethod is invoked.go1.19and provide an older-Go fallback without changing the Go 1.17 module requirement.go1.21build tag to retain compatibility with the module's older language version.The original 14-case regression fails only the reported atomic case before the fix and passes afterward. The full module race suite,
go vet ./..., generation, and formatting pass on Go 1.26.2/macOS arm64. The same 14-case external consumer passes with the actual Go 1.19.13 compiler/runtime and default vet/linking. The broader Go-version matrix was not run locally and remains for CI.Motivation
Equaldocuments equality of referenced values. Two*atomic.Pointer[int]values holding distinct pointers to equal integers currently fail that comparison. This implements the atomic-pointer behavior requested in #1403 while retaining the maintainer's restriction against dereferencingunsafe.Pointer.Example usage
Related issues
Fixes #1403.
OpenAI Codex assisted with the implementation and tests; a separate Codex agent reviewed the patch and verification evidence.