-
Notifications
You must be signed in to change notification settings - Fork 18.1k
fmt.Printf("%p", &a) changes result of pointer of empty struct comparison #68701
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
closing issue since it's expected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go version
go version go1.22.5 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/nt37zxXTC3w
What did you see happen?
Pointer comparison results are not the same after pointer print statements
What did you expect to see?
fmt.Println(&a == &b)
should always producefalse
, the print statements should not affect its result.The text was updated successfully, but these errors were encountered: