Repository navigation
fix: honor Equal methods on non-struct values - #72
Merged
daniel-nichter merged 1 commit intoOct 13, 2026
Merged
Conversation
Move the existing method dispatch before kind-specific comparison, preserving its exported-field and argument-type guards. Add regressions for net.IP representations and named scalar values. Fixes go-test#32
daniel-nichter
marked this pull request as ready for review
October 13, 2026 15:42
Member
|
Thank you for the fix, @guocn. I'll release in v1.1.2, which will put it in v1.2.0 too once that is released. |
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.
fix: honor Equal methods on non-struct values
Fixes #32
Summary
Tests
Using Go 1.26.9 linux/amd64 at /root/.hermes/cache/scratch/go/bin/go:
go test -run '^TestEqualMethodOn' -count=1 -v ./...FAILS with expected IP representation and named-string diffs.go test -count=1 ./...: PASS.go test -race -count=1 ./...: PASS.go vet ./...: PASS.git diff --cached --check: PASS.Logs: ../logs/{before-fail,after-pass,suite,race,vet}.log
Contribution policy and duplication
README.md, SECURITY.md, LICENSE and tracked .github files were inspected. No CONTRIBUTING/AGENTS/AI policy is present; go-test/.github returned 404. Explicit AI acceptance is therefore UNKNOWN, not assumed. This patch and draft were prepared with AI assistance; a human should review and confirm maintainer acceptance before submission.
All available PRs (35, fitting one API page), current open PRs, issue comments, and PR #49 discussion were inspected. PR #49 previously attempted this fix in a broad refactor, was closed without merge, and its maintainer requested small isolated changes preserving the existing suite. Current open PR #71 concerns concurrent Differ support; its head deep.go still contains the same struct-only Equal dispatch and does not fix #32. No active matching implementation found.
Scope and limitations
Submitted as a draft for maintainer feedback; no deployment. No production systems changed. Only deep.go and equal_method_test.go belong to the commit.
Existing malformed Equal-method signature handling and pointer-receiver semantics are unchanged. This does not repair unrelated thread-safety of package-global configuration or cyclic graphs. Tests run on Linux amd64/Go 1.26.9 only, not the complete upstream OS/Go matrix. Independent reviewer subagent capability is unavailable in this delegated session; request parent/human review before publishing. New scalar regression was also verified against the pristine baseline after implementing the general dispatch move; the original IP regression was written and observed failing before any implementation changes.