Skip to content

Commit a26ecc1

Browse files
committed
Merge pull request #246 from go-sql-driver/buffer
remove buffer and driver indirections
2 parents 0183433 + 250dc1d commit a26ecc1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

buffer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ type buffer struct {
2424
length int
2525
}
2626

27-
func newBuffer(rd io.Reader) *buffer {
27+
func newBuffer(rd io.Reader) buffer {
2828
var b [defaultBufSize]byte
29-
return &buffer{
29+
return buffer{
3030
buf: b[:],
3131
rd: rd,
3232
}

connection.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
type mysqlConn struct {
21-
buf *buffer
21+
buf buffer
2222
netConn net.Conn
2323
affectedRows uint64
2424
insertId uint64
@@ -124,7 +124,7 @@ func (mc *mysqlConn) Close() (err error) {
124124
}
125125

126126
mc.cfg = nil
127-
mc.buf = nil
127+
mc.buf.rd = nil
128128

129129
return
130130
}

driver.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func RegisterDial(net string, dial DialFunc) {
4545
// Open new Connection.
4646
// See https://github.com/go-sql-driver/mysql#dsn-data-source-name for how
4747
// the DSN string is formated
48-
func (d *MySQLDriver) Open(dsn string) (driver.Conn, error) {
48+
func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
4949
var err error
5050

5151
// New mysqlConn

0 commit comments

Comments
 (0)