Skip to content

strings: add AppendJoin function for strings.Builder #42850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

suzaku
Copy link

@suzaku suzaku commented Nov 27, 2020

With the existing API, we have to call Join and then
Builder.WriteString to append a joined string to an existing Builder.

If AppendJoin is supported like in C#'s StringBuilder.AppendJoin, we can
avoid some extra allocation (Join creates a strings.Builder under the
hood).

@google-cla google-cla bot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Nov 27, 2020
With the existing API, we have to call Join and then
Builder.WriteString to append a joined string to an existing Builder.

If AppendJoin is supported like in C#'s StringBuilder.AppendJoin, we can
avoid some extra allocation (Join creates a strings.Builder under the
hood).
@suzaku suzaku force-pushed the builder-append-join branch from 8b9eab5 to 3756cc7 Compare November 27, 2020 00:47
@gopherbot
Copy link
Contributor

This PR (HEAD: 3756cc7) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/273646 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1: Code-Review-2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/273646.
After addressing review feedback, remember to publish your drafts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants