logoalt Hacker News

OutOfHere • today at 2:08 PM • 2 replies • view on HN

Go is in no way automatically memory safe. It's up to the programmer to write memory safe code with it.


Replies

typical182 • today at 3:06 PM

Go is broadly considered to be a memory safe language.

See for example comments from tptacek like:

https://news.ycombinator.com/item?id=43335748

https://news.ycombinator.com/item?id=46028232

https://news.ycombinator.com/item?id=44672371

(The gist: memory safety is a term of art coined by security practitioners. Go, Python, Rust, Java, others: memory safe. C/C++: memory unsafe. Periodically, people in different slices of industry or academia come up with new definitions of memory safety that declare Rust or Go or other languages to be memory unsafe, but that is not by the broadly accepted definition across industry.)

➕ show 1 reply
seki285 • today at 3:10 PM

No idea why you're getting downvoted for true statement. Without a ? like in C# you're always at risk of a nil pointer being dereferenced

➕ show 1 reply