good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit e6a7e0e8 authored by Anmol Sethi's avatar Anmol Sethi
Browse files

main_test.go: Add to detect goroutine leaks

Updates #330
parent 108d137e
Loading
package websocket_test
import (
"fmt"
"os"
"runtime"
"testing"
)
func TestMain(m *testing.M) {
code := m.Run()
if runtime.NumGoroutine() != 1 {
fmt.Fprintf(os.Stderr, "goroutine leak detected, expected 1 but got %d goroutines\n", runtime.NumGoroutine())
os.Exit(1)
}
os.Exit(code)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment