You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the previous issue is old, the points discussed there still hold. Without significant new information, a rehash of a previous discussion is just going to end up with the same decision.
Proposal Details
For slices, the handling of
nil
is easy:Above code works fine if
s
is nil.But for maps, this does not work.
Checking if a map is nil, and if it is, doing
make(...)
is not convenient.I propose to extend
append()
to maps:Above should work, even if m is
nil
.I am looking to a solution to the overall goal (Better way of handling nil maps).
Maybe there is a better syntax to do that....
What alternatives to
m = append(m, key, value)
do you suggest?The text was updated successfully, but these errors were encountered: