public static void NumGoroutine() { // Test that there are just the expected number of goroutines // running. Specifically, test that the spare M's goroutine // doesn't show up. { var(_, ok) = checkNumGoroutine("first", 1L + baseGoroutines); if (!ok) { return; } // Test that the goroutine for a callback from C appears. } // Test that the goroutine for a callback from C appears. C.CheckNumGoroutine(); if (!callbackok) { return; } // Make sure we're back to the initial goroutines. { (_, ok) = checkNumGoroutine("third", 1L + baseGoroutines); if (!ok) { return; } } fmt.Println("OK"); }