This one has come up a couple times for Go
here, but I think my experience is unique. Here are my codes.
type Stack []Weight
func newStack( size int, startSpread Spread ) Stack {
stack := make(Stack, size)
for _, curWeight := range stack {
curWeight = Weight{ startSpread, rand.Float64( ), rand.Float64( ) }
}
return stack
}
Why is gc
telling me I'm not using curWeight
?