go-pmem icon indicating copy to clipboard operation
go-pmem copied to clipboard

pnew(string) should panic

Open mohit10verma opened this issue 5 years ago • 0 comments

In Go, a string is internally a slice of bytes. Right now we don't support creating a slice with pnew() builtin. Currently, code like s := pnew(slice) *s = "hello"

works. But s is actually pointing to volatile memory. This will create confusion. Instead, we should panic for now.

mohit10verma avatar Feb 27 '19 00:02 mohit10verma