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
Closed

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

gbbr opened this issue Jan 9, 2019 · 2 comments

Comments

@gbbr
Copy link
Member

@gbbr gbbr 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

@bcmills bcmills commented Jan 9, 2019

@bcmills bcmills closed this Jan 9, 2019
@gbbr

This comment has been minimized.

Copy link
Member Author

@gbbr gbbr commented Jan 9, 2019

Thanks! 🙇‍♂

@golang golang locked and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.