Is there any way to get the variable name from the underlying pointer type? 
I couldn't figure it out how to get the name of the variable from the 
pointer type, since that name doesn't exist anymore at runtime. 

- https://go.dev/play/p/ulaiQ1F4hbQ

My use-case: Image I have a large list of `*bar`. When traversing, I have 
to check each item whether nil or not. So that I can print the variable 
name of nil pointer type. Which would save me from hours of debugging.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/808d310f-59d2-4c29-b3a9-f35b33ffc0a9n%40googlegroups.com.

Reply via email to