logoalt Hacker News

netheril96today at 2:46 AM1 replyview on HN

I've swinged between Go and Rust for my personal projects multiple times. For work, it is decided by the management so not my problem.

The biggest gripe I have with Go is the lack of *any* compile time check for mutex. Even C++ has extensions like ABSL_GUARDED_BY. For a language so proud on concurrency, it is strange not to have any guardrails.


Replies

ted_dunningtoday at 2:58 AM

The guardrails are channels.

If you have a mutex on a structure, linters such as are packaged into Goland will catch oversights quite effectively.

If you are using fancier concurrency structures, you should consider channels instead.

show 1 reply