I've noticed that cmd/vet's rangeloop check, which warns you about binding 
to range loop variables in function literals which are launched with 'go' 
or 'defer', is more limited than I thought:



> This file contains the code to check range loop variables bound inside 
> function literals that are deferred or launched in new goroutines. We only 
> check instances where the defer or go statement is the last statement in 
> the loop body, as otherwise we would need whole program analysis.

I don't understand why whole program analysis is necessary here. Why can't 
cmd/vet check each function literal declared within the loop's braces?

You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to