File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff 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-
3222type 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
616606func (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 :
You can’t perform that action at this time.
0 commit comments