Replies: 2 comments
-
V returns the default value for the type of result. In this case the default value for a pointer (pointer to int to be more specific) is nil. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can even use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think that accessing invalid key in map should panic like array. The current behavior returns "default value", which is not consistent with array.
Sometimes, the default value isn't desired:
Beta Was this translation helpful? Give feedback.
All reactions