Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

pnew(string) should panic #2

Open
mohit10verma opened this issue Feb 27, 2019 · 0 comments
Open

pnew(string) should panic #2

mohit10verma opened this issue Feb 27, 2019 · 0 comments

Comments

@mohit10verma
Copy link
Collaborator

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant