Issue description
As the subject implies, RegisterDial is not safe to call from multiple goroutines.
|
func RegisterDial(net string, dial DialFunc) { |
Example code
var wg sync.WaitGroup
wg.Add(1)
go func() {
mysql.RegisterDial("dial1", func(string) (net.Conn, error) { return nil, errors.New("bork") })
wg.Done()
}()
go func() {
mysql.RegisterDial("dial2", func(string) (net.Conn, error) { return nil, errors.New("bork") })
wg.Done()
}()
wg.Wait()
sql.Open("mysql", /* ... */)