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

Remove purego fallbacks #325

Merged
merged 1 commit into from Feb 22, 2023
Merged

Remove purego fallbacks #325

merged 1 commit into from Feb 22, 2023

Conversation

cespare
Copy link
Contributor

@cespare cespare commented Feb 22, 2023

Having go-cmp panic when using the purego build tag makes it hard to use go-cmp for testing packages that themselves have purego fallbacks.

Since go-cmp can't implement its functionality without unsafe (the "fallback" panics) and since environments that prohibit unsafe are much less common these days anyway, simply remove purego code entirely.

Fixes #283.

Having go-cmp panic when using the purego build tag makes it hard to use
go-cmp for testing packages that themselves have purego fallbacks.

Since go-cmp can't implement its functionality without unsafe (the
"fallback" panics) and since environments that prohibit unsafe are much
less common these days anyway, simply remove purego code entirely.

Fixes google#283.
@cespare
Copy link
Contributor Author

cespare commented Feb 22, 2023

As a side benefit, go-cmp's own tests now pass with -tags purego :)

Copy link
Collaborator

@dsnet dsnet left a comment

Choose a reason for hiding this comment

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

LGTM, but @neild is the gatekeeper as I no longer work at Google. IIRC, it was Google AppEngine that was forcing the need for this, which was long on the deprecation chopping block by the time I left.

@dsnet dsnet requested a review from neild February 22, 2023 20:04
@neild neild merged commit 571a56b into google:master Feb 22, 2023
@neild
Copy link
Collaborator

neild commented Feb 22, 2023

SGTM

@cespare
Copy link
Contributor Author

cespare commented Feb 22, 2023

Thanks @neild!

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.

Add build tag to force use of unsafe even with purego?
3 participants