-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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
fmt.Printf %p should handle more types #441
Labels
Comments
You can print address of array pointer, isn't it ? var a = [...]int {1, 2, 3}; fmt.Printf("pointer %p\n", &a); maps, slice, channel are all reference type, why do you want a reference's address? Only data that reference point to has meaning, like. var b = a[0:]; fmt.Printf("pointer %p\n", &b[0]); |
being able to print the address of a mutable data structure is very useful for debugging - there's no other easy way to verify that two pieces of code are talking to the same thing. currently, %v will print the address of a channel, but there's no way to do the same with the others, except with the builtin function print, which only works to stdout. |
Owner changed to r...@golang.org. |
This issue was closed by revision 2e853ec. Status changed to Fixed. Merged into issue #-. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: