Comment by jjcm
Comment by jjcm 9 days ago
Great tips in here - I was not aware of `go vet` nor `go test -race`.
FWIW, while go is not memory safe, I do find that it's much easier to be safe in go than it is in other languages. Its verboseness lends to a very clear understanding of what's happening in any given function. I absolutely hated this at the start, but now ~3 years into maintaining a go codebase, I find it quite nice both for debugging as well as editing old code. I know exactly what each function does, and what the structure of data is in any given context.
Another interesting side effect is that AI tools seem to work amazingly well with golang, given how context is often local to the function.
Go very much is memory safe in the absence of data races.
Data races cause issues in all languages, though it's fair to say that Go is affected slightly more than languages like Java. Rust is a bit special by making data races hard to trigger (impossible in safe code IIUC), but this is not typical.