How cgo silently disables Go's deadlock detector

I recently ran into a Go test timeout that turned out to be a deadlock. That was surprising because Go has a built-in deadlock detector. The simplest possible deadlock is a goroutine that locks the same mutex twice. Running the following code exits with fatal error: all goroutines are asleep - deadlock! as expected. 1package main 2 3import 'sync' 4 5func main() { 6 var mu sync.Mutex 7 mu.Lock() 8…