Skip to content

Commit 64cea2f

Browse files
authored
Remove mysqlContext (go-sql-driver#886)
It is not needed anymore because we dropped Go 1.7 support
1 parent dea3c7b commit 64cea2f

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

connection.go

+3-13
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ import (
1919
"time"
2020
)
2121

22-
// a copy of context.Context for Go 1.7 and earlier
23-
type mysqlContext interface {
24-
Done() <-chan struct{}
25-
Err() error
26-
27-
// defined in context.Context, but not used in this driver:
28-
// Deadline() (deadline time.Time, ok bool)
29-
// Value(key interface{}) interface{}
30-
}
31-
3222
type mysqlConn struct {
3323
buf buffer
3424
netConn net.Conn
@@ -45,7 +35,7 @@ type mysqlConn struct {
4535

4636
// for context support (Go 1.8+)
4737
watching bool
48-
watcher chan<- mysqlContext
38+
watcher chan<- context.Context
4939
closech chan struct{}
5040
finished chan<- struct{}
5141
canceled atomicError // set non-nil if conn is canceled
@@ -614,13 +604,13 @@ func (mc *mysqlConn) watchCancel(ctx context.Context) error {
614604
}
615605

616606
func (mc *mysqlConn) startWatcher() {
617-
watcher := make(chan mysqlContext, 1)
607+
watcher := make(chan context.Context, 1)
618608
mc.watcher = watcher
619609
finished := make(chan struct{})
620610
mc.finished = finished
621611
go func() {
622612
for {
623-
var ctx mysqlContext
613+
var ctx context.Context
624614
select {
625615
case ctx = <-watcher:
626616
case <-mc.closech:

0 commit comments

Comments
 (0)