Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Even if there were ever a string long enough to justify splitting up the work, spinning up a goroutine for every single character would not be an efficient way of distributing the work. While goroutines are cheap, they’re not free.
Another fun thing is that
len(string)
returns the number of bytes in the string, not the number of runes in it. This means if we have just one rune> utf8.RuneSelf
this will deadlock, as it will attempt to receivest = <-ret
for the number of bytes in string, while we will only spin off ado_work
for every rune in the string.Once we fix that, we still end up with weird behavior, where there are
\x00
values in your string because you’re indexing off the byte-length ofs
into the rune slice. https://play.golang.org/p/9WcBHj0hiQK