// NewFakeFactory returns a mysql.SQLRunnerFactory but with the fake SQLRunner received as parameter
NewFakeFactory returns a mysql.SQLRunnerFactory but with the fake SQLRunner received as parameter
// NewFakeFactory returns a mysql . SQLRunnerFactory but with the fake SQLRunner received as parameter
func NewFakeFactory(fakeSR *SQLRunner) mysql.SQLRunnerFactory {
	return func(cfg *mysql.Config, errs ...error) (mysql.SQLRunner, func(), error) {
		if len(errs) > 0 && errs[0] != nil {
			return nil, func() {}, errs[0]
		}
		fakeSR.lock.Lock()
		defer fakeSR.lock.Unlock()
		fakeSR.dsn = cfg.GetMysqlDSN()
		return fakeSR, func() {}, nil
	}
}
func NewFakeFactory ( fakeSR * SQLRunner ) mysql . SQLRunnerFactory { return func ( cfg * mysql . Config , errs ... error ) ( mysql . SQLRunner , func ( ) , error ) { if len ( errs ) > 0 && errs [ 0 ] != nil { return nil , func ( ) { } , errs [ 0 ] } fakeSR . lock . Lock ( ) defer fakeSR . lock . Unlock ( ) fakeSR . dsn = cfg . GetMysqlDSN ( ) return fakeSR , func ( ) { } , nil } }
NewFakeFactory returns a mysql.SQLRunnerFactory but with the fake SQLRunner received as parameter
NewFakeFactory returns a mysql . SQLRunnerFactory but with the fake SQLRunner received as parameter