@Kaveh Slices are values but they refer to the same back array location. You have created localized v which is appended inside goroutine which refer to a location containing its own byte array of len=10. So, you are not really referencing the same memory location as other v slice in the goroutine. You will be affected if you remove k,v:=k,v or append more than 10 bytes to v inside goroutine which will take up space on next slice's bytes.
On Saturday, April 21, 2018 at 2:30:53 PM UTC+5:30, Kaveh Shahbazian wrote: > > @ Louki Sumirniy > Slices are values AFAIK. There is no passby pointer. > > And the point is, race detector does not flag anything: > https://play.golang.org/p/NC8mBwS1-0P > -- 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.