File tree 1 file changed +3
-13
lines changed
1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,6 @@ import (
19
19
"time"
20
20
)
21
21
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
-
32
22
type mysqlConn struct {
33
23
buf buffer
34
24
netConn net.Conn
@@ -45,7 +35,7 @@ type mysqlConn struct {
45
35
46
36
// for context support (Go 1.8+)
47
37
watching bool
48
- watcher chan <- mysqlContext
38
+ watcher chan <- context. Context
49
39
closech chan struct {}
50
40
finished chan <- struct {}
51
41
canceled atomicError // set non-nil if conn is canceled
@@ -614,13 +604,13 @@ func (mc *mysqlConn) watchCancel(ctx context.Context) error {
614
604
}
615
605
616
606
func (mc * mysqlConn ) startWatcher () {
617
- watcher := make (chan mysqlContext , 1 )
607
+ watcher := make (chan context. Context , 1 )
618
608
mc .watcher = watcher
619
609
finished := make (chan struct {})
620
610
mc .finished = finished
621
611
go func () {
622
612
for {
623
- var ctx mysqlContext
613
+ var ctx context. Context
624
614
select {
625
615
case ctx = <- watcher :
626
616
case <- mc .closech :
You can’t perform that action at this time.
0 commit comments