-
Notifications
You must be signed in to change notification settings - Fork 209
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 build tag to force use of unsafe even with purego? #283
Comments
Maybe it would be best to remove To put it another way, if I were writing code for an environment where unsafe is disallowed (and who does, in 2021?) I would avoid using go-cmp altogether; with or without its Regarding |
I'd support that course of action. It's been a long time, but if I recall correctly, one major motivation behind I was not fond of the constraints that AppEngine placed on the rest of the Go ecosystem. By the time I left Google, AppEngine has been on the deprecation chopping block for a long time. I don't know what it's current status is. |
Ping @neild. WDYT about removing the use of |
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.
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.
In golang/go#23172 (comment), @cespare writes:
I'm not sure what the right fix is, but perhaps an explicit
gocmp_unsafe
build tag that enables the use ofunsafe
even ifpurego
is specified? There isn't an obvious fix here since we must useunsafe
to introspect unexported fields.\cc @neild
The text was updated successfully, but these errors were encountered: