Closure not doing what I expect


There is this problem that increment is ok, but setting to 1 is not. Go says “variable is unused”, but it’s not. I tracked down this problem from a bigger part of some source code and don’t really know what triggers it. It feels like a bug in Go but probably is not.

Thank you…

Solved it. Go detected that I was not returning xx way down in the code. It’s just so hard to see where I forgot to use the variable in question. The whole “unused” thing is so irritating to me although I have been using Go for a while. Sorry.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.