func (c Config) Validate() error {
	if c.ConnectTimeout.Round(time.Second) != c.ConnectTimeout {
		return ex.New(ErrDurationConversion, ex.OptMessagef("connect_timeout=%s", c.ConnectTimeout))
	}
	if c.LockTimeout.Round(time.Millisecond) != c.LockTimeout {
		return ex.New(ErrDurationConversion, ex.OptMessagef("lock_timeout=%s", c.LockTimeout))
	}
	if c.StatementTimeout.Round(time.Millisecond) != c.StatementTimeout {
		return ex.New(ErrDurationConversion, ex.OptMessagef("statement_timeout=%s", c.StatementTimeout))
	}

	return nil
}
// Validate validates that user-provided values are valid, e.g. that timeouts
// can be exactly rounded into a multiple of a given base value.
Validate validates that user-provided values are valid, e.g. that timeouts
can be exactly rounded into a multiple of a given base value.
// Validate validates that user - provided values are valid e . g . that timeouts // can be exactly rounded into a multiple of a given base value .
func (c Config) Validate() error {
	if c.ConnectTimeout.Round(time.Second) != c.ConnectTimeout {
		return ex.New(ErrDurationConversion, ex.OptMessagef("connect_timeout=%s", c.ConnectTimeout))
	}
	if c.LockTimeout.Round(time.Millisecond) != c.LockTimeout {
		return ex.New(ErrDurationConversion, ex.OptMessagef("lock_timeout=%s", c.LockTimeout))
	}
	if c.StatementTimeout.Round(time.Millisecond) != c.StatementTimeout {
		return ex.New(ErrDurationConversion, ex.OptMessagef("statement_timeout=%s", c.StatementTimeout))
	}
	return nil
}
func ( c Config ) Validate ( ) error { if c . ConnectTimeout . Round ( time . Second ) != c . ConnectTimeout { return ex . New ( ErrDurationConversion , ex . OptMessagef ( " " , c . ConnectTimeout ) ) } if c . LockTimeout . Round ( time . Millisecond ) != c . LockTimeout { return ex . New ( ErrDurationConversion , ex . OptMessagef ( " " , c . LockTimeout ) ) } if c . StatementTimeout . Round ( time . Millisecond ) != c . StatementTimeout { return ex . New ( ErrDurationConversion , ex . OptMessagef ( " " , c . StatementTimeout ) ) } return nil }
Validate validates that user-provided values are valid, e.g.
Validate validates that user - provided values are valid e . g .