I think the question is, does this conversion expression allocate a
byte array each for the string and the []byte, initialize the string,
then copy its contents to the []byte, or does it just allocate one
byte array, initialize it, then return a []byte referring to that
memory?
Only the []byte is allocated at runtime. The const string is part of
the program's data segment. (I think.)
Andrew
The []byte will just be a slot on the stack and the underlying data for the slice will be allocated on the heap, essentially as outlined here (except it should read len("hello")).
-rob