← Back to context

Comment by osigurdson

11 hours ago

A goroutins shares memory so you can just share variables if you want. It is basically the same as any other language in this regard.

Haha! Laughing at my own comment: "a goroutins shares memory". The iPhone keyboard wins again.

It's also just as easy to incorrectly share memory and cause race conditions. There's no protection against it and it violates memory safety.

  • For sure. The parent comment was merely asking if it could be done without channels or mutex, not if it was a good idea or not. Of course sometimes it is indeed the right thing to do.