by codezero · 13y ago · 0 comments
When you only provide one variable for assignment, you are actually assigning the key (or incremental value), not the value, the syntax is:
for key, value: := range someThing {
When you do: for something := range someThing {
something won't have the value. If you just want the value you need to use: for _, value := range someThing {No comments yet.