I know a string value can be used as []byte if the first parameter if the builtin copy/append function is a []byte value:
> var bs []byte = make([]byte, 10) > copy(bs, "abcde") but if do explicit conversion anyway on the second string value > var bs []byte = make([]byte, 10) > copy(bs, []byte("abcde")) > will compiler do optimization here to avoid copying the underline byte array of the string? -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.