Hacker News new | ask | show | jobs
by beltsazar 952 days ago
> Sounds like you may be confused thinking that a panic in Go is like throw in other languages?

Not at all. I knew that panics in Go shouldn't be used for error handling in general.

> Third-party libraries should virtually never panic.

True, as true as 3rd-party libraries shouldn't have any security vulnerabilities. But we don't live in a perfect world. Bugs happen.

> This is a bit like worrying that your programming language won't prevent a third-party library from sending a SIGKILL to your program or that it doesn't prevent third-party libraries from delete your entire file system.

Very different. Your examples are intentional and malicious actions. What usually happens is due to bugs.

> No general purpose language protects against malicious or stupid code.

Are you implying that all bugs are caused by either malicious code or stupid code? Panic-related bugs are often due to the billion dollar mistake [1] that Go's team refused to solve.

---

[1] https://www.infoq.com/presentations/Null-References-The-Bill...