Skip to content

for on a map reuses the same address for values #17303

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

Closed
OneOfOne opened this issue Sep 30, 2016 · 4 comments
Closed

for on a map reuses the same address for values #17303

OneOfOne opened this issue Sep 30, 2016 · 4 comments

Comments

@OneOfOne
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

Go 1.4 -> tip as of today

What operating system and processor architecture are you using (go env)?

Linux 64bit

What did you do?

https://play.golang.org/p/wbn3YAwyVD

What did you expect to see?

Different pointers.

What did you see instead?

The same pointer.

Judging since this existed since 1.4 I'm guessing it's a part of the spec but for the life of me I couldn't find it.

@bradfitz
Copy link
Contributor

This is how the language is defined. Working as defined.

@bradfitz
Copy link
Contributor

For questions, see https://golang.org/wiki/Questions

@bradfitz bradfitz reopened this Sep 30, 2016
@minux
Copy link
Member

minux commented Sep 30, 2016 via email

@OneOfOne
Copy link
Contributor Author

@minux I can't believe after all those years (answering that very question with goroutines 100 times on SO), I missed that, thank you.

@golang golang locked and limited conversation to collaborators Sep 30, 2017
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