No, you are not even using the mutex in that code...

> On Feb 2, 2019, at 4:43 AM, [email protected] wrote:
> 
> I think you can change it like below:
>  
> var rm sync.Mutex
> var ts [2]string
> for i, s := range []string{"first", "second"} {
>       i, s := i, s
>       go func(i int, s string){
>               ts[i] = s
>       }(i,s)
> }
> 
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to