Comment by Mond_

2 days ago

It doesn't exactly, no. There are linters and a compiler-enforced check preventing unused variables. Overall it's pretty easy to accidentally drop errors or overwrite them before checking.

So no, it doesn't.

Well at least you shouldn’t be able to actually dereference a nil, right?

  • You'll get a runtime panic.

    Hey, it's better than lurking undefined behavior and data corruption issues!

    Doesn't keep your binary from crashing, though.

  • Sadly, and imo almost unforgivably in such a modern language, no

    • fwiw Go is simple, can be easily translated from TypeScript thanks to how similar it is, and has a GC, so you don’t have to learn what the hell a borrow checker is