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

spec: Support multiple return from map lookup #10947

Closed
vasiliicuhar opened this issue May 25, 2015 · 3 comments
Closed

spec: Support multiple return from map lookup #10947

vasiliicuhar opened this issue May 25, 2015 · 3 comments

Comments

@vasiliicuhar
Copy link

Hello. I am new to golang, but there is a small proposal.
I don`t know how this affects other parts, may be you will help understand them.
Look at this sample of code: http://play.golang.org/p/ik8RK3p5i7

Seems like compiler doesn`t understand that should return two arguments instead of
s := m["A"] syntax.

Commented code works fine, but is a bit ugly.
Looks like backward-compatible change for me.

@minux minux closed this as completed May 25, 2015
@minux
Copy link
Member

minux commented May 25, 2015 via email

@mikioh mikioh changed the title Support multiple return from map lookup spec: Support multiple return from map lookup May 26, 2015
@ALTree
Copy link
Member

ALTree commented May 26, 2015

This was discussed in the past on the mailing list, e.g. here. The last post explains the design decision behind the status quo.

@vasiliicuhar
Copy link
Author

Thank you for link. Provided solution with named return arguments is pretty cool.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants