Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
osigurdson
· 2mo ago · 0 comments
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.
Comments
[–]
treyd
2mo ago
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.
[–]
osigurdson
OP
2mo ago
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.
[–]
osigurdson
OP
2mo ago
Haha! Laughing at my own comment: "a goroutins shares memory". The iPhone keyboard wins again.