I mean convert using s := "abcefg" b := []byte(s) s2 := string(b)
not convert using some unsafe.Pointer trick. On Friday, January 29, 2021 at 8:51:57 PM UTC+8 xie cui wrote: > does convert string to []byte, and convert []byte to string alway alloc > new space, and the new space is in heap? > if it is not, please show some demo codes? > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/18219e42-1a46-42ba-a28b-2b432ccc0a40n%40googlegroups.com.