Skip to content
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

proposal: runtime: mapaccess shouldn’t panic on nil map #29631

Closed
gbbr opened this issue Jan 9, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@gbbr
Copy link
Member

commented Jan 9, 2019

I have a feeling this might have been discussed before, but I couldn’t find an issue. If it exists, please close this one.

Is there any benefit in having mapaccess panic on nil maps?
https://github.com/golang/go/blob/master/src/runtime/map.go#L57

Is there any down side to having a map automatically “made” (makemap) when it is nil? This would mirror the behaviour of slices too: appending to a nil slice creates it.

@gopherbot gopherbot added this to the Proposal milestone Jan 9, 2019

@gopherbot gopherbot added the Proposal label Jan 9, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

@bcmills bcmills closed this Jan 9, 2019

@gbbr

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2019

Thanks! 🙇‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.