4 ms·
Edit: removed (can’t seem to delete?)
by leCapitalist 7y ago
Edit: removed (can’t seem to delete?)
- harikb 7y agoNo, GP was taking about a clear race condition on growing the slice in the first example. It is not just a case of "idiomatic go" vs "idiomatic" or something, as the author suggested, a problem only when the code grows. It is a critical bug in the first example. Edit: add what one gets when run with `go run -race` > WARNING: DATA RACE > Read at 0x00c0000a6000 by goroutine 8: > runtime.growslice()
- deleted 7y ago[deleted]