@@ -2,9 +2,12 @@ package sqlmock
22
33import "database/sql/driver"
44
5+ // SqlMockOption is the type defining an option used to configure an SqlMock at creation
6+ type SqlMockOption func (* sqlmock ) error
7+
58// ValueConverterOption allows to create a sqlmock connection
69// with a custom ValueConverter to support drivers with special data types.
7- func ValueConverterOption (converter driver.ValueConverter ) func ( * sqlmock ) error {
10+ func ValueConverterOption (converter driver.ValueConverter ) SqlMockOption {
811 return func (s * sqlmock ) error {
912 s .converter = converter
1013 return nil
@@ -14,7 +17,7 @@ func ValueConverterOption(converter driver.ValueConverter) func(*sqlmock) error
1417// QueryMatcherOption allows to customize SQL query matcher
1518// and match SQL query strings in more sophisticated ways.
1619// The default QueryMatcher is QueryMatcherRegexp.
17- func QueryMatcherOption (queryMatcher QueryMatcher ) func ( * sqlmock ) error {
20+ func QueryMatcherOption (queryMatcher QueryMatcher ) SqlMockOption {
1821 return func (s * sqlmock ) error {
1922 s .queryMatcher = queryMatcher
2023 return nil
@@ -30,7 +33,7 @@ func QueryMatcherOption(queryMatcher QueryMatcher) func(*sqlmock) error {
3033// If false is passed or this option is omitted, calls to Ping will not be
3134// considered when determining expectations and calls to ExpectPing will have
3235// no effect.
33- func MonitorPingsOption (monitorPings bool ) func ( * sqlmock ) error {
36+ func MonitorPingsOption (monitorPings bool ) SqlMockOption {
3437 return func (s * sqlmock ) error {
3538 s .monitorPings = monitorPings
3639 return nil
0 commit comments