Re: [go-nuts] Re: The GitHub Vet Project

2021-01-01 Thread K. Alex Mills
> Technically, I believe a range loop variable can be used in a goroutine >> safely. A very contrived example: https://play.golang.org/p/jgZbGg_XP6S . >> In practice I can not see much use for this kind of pattern, but it does >> exist. >> > > It is correct that the range loop variable can be used

Re: [go-nuts] Re: The GitHub Vet Project

2020-12-30 Thread 'Tim King' via golang-nuts
This is a very interesting and ambitious experiment! If successful, this is getting at the type of evidence that would be useful when considering to change the language. When evaluating the change, we will need to find cases where the semantics of the program might differ after the change. Semanti

Re: [go-nuts] Re: The GitHub Vet Project

2020-12-30 Thread K. Alex Mills
Good point, and thanks for the response. This example avoids the race condition by breaking out of the loop immediately afterward. IIRC, loopclosure also reports in case the range loop variable is passed as an argument using a name that shadows the loop variable. I think any loopclosure findings