On Tue, Jun 23, 2020 at 5:32 PM Bill Morgan <[email protected]> wrote:
> I'm a C programmer so maybe this is a dumb question but, why does this > code in runtime/gostring.go allocate (rawstring) then copy data (memmove) > instead of just making the stringStruct.str point at the incoming data? > i.e. copy the pointer instead of allocating+copying data. > Go strings are immutable: https://golang.org/ref/spec#String_types. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- 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 on the web visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD-px_qKwq8mu6iiS7gGPR9OLY8ejNHU_tk-9CSO1cVs1g%40mail.gmail.com.
