I think it's worth filing an issue for at least.

- sean

On Wed, Jan 21, 2026, 04:31 Tom Limoncelli <[email protected]> wrote:

> One of the coolest features of `modernize` is that it turns a series
> of string appends into a strings.Builder + WriteString() statements.
> This is more efficient because it avoids allocations.
>
> However I notice that if the append is multiple strings (s += a + b)
> the transform results in allocations:
>
> -               s += "foo" + myvariable
> +               s.WriteString("foo" + myvariable)
>
> Would it be more efficient to rewrite it as 2 statements:
>
> +               s.WriteString("foo")
> +               s.WriteString(myvariable)
>
> Is this worth filing a feature request or is the potential improvement
> negligible?
>
> Tom
>
> --
> Blog:  https://www.yesthatblog.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/golang-nuts/CAHVFxgmNUYG91Y7oi0CocLRLZxLv%3Dq6oLftZP0H6JjQzihLi8w%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CAGabyPo-GnBV2G2UZ4KYKVjZm%2BXQ4vX4Oo5u3oXG5uK%3DzvMWpg%40mail.gmail.com.

Reply via email to