This is handled by the OS.
If you don't care about the low level details but just want to be sure, check https://pkg.go.dev/net#PacketConn , it says that "Multiple goroutines may invoke methods on a PacketConn simultaneously" (in particular ReadFrom and WriteTo).