-
Notifications
You must be signed in to change notification settings - Fork 18k
reflect: Zero() changes behavior in Go1.16rc1 #43986
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
Comments
possible related change: 8925290 |
reflect
functions change it behavior at Go1.16rc1
cc @randall77 |
I'm thinking it is bad idea comparing two |
given that this is in the docs:
I'm thinking this is not a supported operation |
As others mentioned, do
instead.
|
I concur, this does not look like a bug. Anyway, closing. Please reopen if you think this analysis is wrong. |
Thank you all. I'm satisfied with the conclusion. 👍 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
no. it reprocude with latest release candidate
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run this program with Go 1.16rc1 and 1.15.7
You can get it from https://play.golang.org/p/0tzp7aZhnQ8
What did you expect to see?
reflect.DeepEqual(reflect.Zero(reflect.TypeOf(s)), reflect.ValueOf(s))
returnsfalse
for both Go 1.16rc1 and Go 1.15.7What did you see instead?
Go 1.15.7 returns
false
, but Go 1.16rc1 returnstrue
The text was updated successfully, but these errors were encountered: