We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88edab0 commit d6e1f31Copy full SHA for d6e1f31
2 files changed
conn_test.go
@@ -732,14 +732,6 @@ func TestCloseBadConn(t *testing.T) {
732
defer cn.errRecover(&err)
733
panic(io.EOF)
734
}()
735
- // Verify we can write before closing.
736
- if _, err := nc.Write(nil); err != nil {
737
- t.Fatal(err)
738
- }
739
- // First close should close the connection.
740
- if err := cn.Close(); err != nil {
741
742
743
744
// During the Go 1.9 cycle, https://github.com/golang/go/commit/3792db5
745
// changed this error from
error.go
@@ -506,4 +506,8 @@ func (c *conn) errRecover(err *error) {
506
if *err == driver.ErrBadConn {
507
c.bad = true
508
}
509
+
510
+ if c.bad && c.c != nil {
511
+ c.c.Close()
512
+ }
513
0 commit comments