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.
Or maybe we can pre-allocate the result, so when we do append, go will not change slice header since we allocate it as the size of str input.
result := make([]rune, 0, len(str)
With append you're actually allocating a new array underneath with it's size increased by the ammount of items added. In this case the size of the resulting value is already known so it would be more efficient to allocate a slice of rune with predefined length ( length of the string provided ) and assign the values directly.
explain