Ad
  • Default User Avatar

    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)