3 ms·
> Finally, Go doesn't do anything to prevent data races, which are the biggest problem facing concurrent code. It actually makes data races easier than in langu
by roganartu 8y ago
> Finally, Go doesn't do anything to prevent data races, which are the biggest problem facing concurrent code. It actually makes data races easier than in languages like C++, because it has no concept of const, even as a lint. Race detectors have long existed in C++ as well, at least as far back as Helgrind.
While it can't guarantee correctness outside of runtime (and even then, obviously only if whatever you are running actually triggers the race), a race detector has been part of the Go core since 2012[1].
[1]: https://blog.golang.org/race-detector https://blog.golang.org/race-detector
- anonacct37 8y agoAlso there's a "best effort" concurrent map access detector that runs even when you don't compile with race detector support enabled.