Go is kind of broken here, since multithreading is one of extremely few ways to cause UB in Go.

Rust is very much best in class here.