3 ms·
Unused variables have nothing to do with memory safety. At most they'll take up some stack or heap space. https://en.wikipedia.org/wiki/Memory_safety https://e
by wting 11y ago
Unused variables have nothing to do with memory safety. At most they'll take up some stack or heap space.
https://en.wikipedia.org/wiki/Memory_safety https://en.wikipedia.org/wiki/Memory_safety
Memory safety is enforced in Go via best practices–like C and C++ ecosystems. However because of gc and channels race conditions happen less often in Go but there's no explicitly tooling to prevent them from happening:
http://research.swtch.com/gorace http://research.swtch.com/gorace
- Kabukks 11y agoYou are right. I was thinking about the general fail-safety of my programs. Not letting me compile saved me from overlooking a (return) value more than once.
- threeseed 11y agoYou could accomplish the same thing by incorporating a code checker as part of your build process. That way you would be catching a lot more code issues then just unused imports, variables etc.