Created
September 15, 2017 09:00
-
-
Save mbn18/b9052187984cba8e8f12bda17a8474bd to your computer and use it in GitHub Desktop.
Why the second range fail?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type list []*item | |
// Work | |
for g := range *list { | |
z := *list | |
println(z[g].Name) | |
} | |
// Fail | |
for g := range *list { | |
println(*list[g].Name) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error is