Skip to content

Commit b66d043

Browse files
neetlemethane
authored andcommittedDec 12, 2019
Remove "go1.10" build tag (go-sql-driver#1016)
Some IDEs and editors refuse to acknowledge the "go1.10" build tag when autocompleting & compiling. Removing said tag increases usibility of the library for those stuck with these editors.
1 parent 94084c9 commit b66d043

File tree

5 files changed

+192
-227
lines changed

5 files changed

+192
-227
lines changed
 

‎AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Lucas Liu <extrafliu at gmail.com>
6363
Luke Scott <luke at webconnex.com>
6464
Maciej Zimnoch <maciej.zimnoch at codilime.com>
6565
Michael Woolnough <michael.woolnough at gmail.com>
66+
Nathanial Murphy <nathanial.murphy at gmail.com>
6667
Nicola Peduzzi <thenikso at gmail.com>
6768
Olivier Mengué <dolmen at cpan.org>
6869
oscarzhao <oscarzhaosl at gmail.com>

‎driver.go

+22
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,25 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
8383
func init() {
8484
sql.Register("mysql", &MySQLDriver{})
8585
}
86+
87+
// NewConnector returns new driver.Connector.
88+
func NewConnector(cfg *Config) (driver.Connector, error) {
89+
cfg = cfg.Clone()
90+
// normalize the contents of cfg so calls to NewConnector have the same
91+
// behavior as MySQLDriver.OpenConnector
92+
if err := cfg.normalize(); err != nil {
93+
return nil, err
94+
}
95+
return &connector{cfg: cfg}, nil
96+
}
97+
98+
// OpenConnector implements driver.DriverContext.
99+
func (d MySQLDriver) OpenConnector(dsn string) (driver.Connector, error) {
100+
cfg, err := ParseDSN(dsn)
101+
if err != nil {
102+
return nil, err
103+
}
104+
return &connector{
105+
cfg: cfg,
106+
}, nil
107+
}

‎driver_go110.go

-37
This file was deleted.

‎driver_go110_test.go

-190
This file was deleted.

0 commit comments

Comments
 (0)