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 9eb73ef commit f51b554Copy full SHA for f51b554
2 files changed
conn_test.go
@@ -733,14 +733,6 @@ func TestCloseBadConn(t *testing.T) {
733
defer cn.errRecover(&err)
734
panic(io.EOF)
735
}()
736
- // Verify we can write before closing.
737
- if _, err := nc.Write(nil); err != nil {
738
- t.Fatal(err)
739
- }
740
- // First close should close the connection.
741
- if err := cn.Close(); err != nil {
742
743
744
745
// During the Go 1.9 cycle, https://github.com/golang/go/commit/3792db5
746
// changed this error from
error.go
@@ -512,4 +512,8 @@ func (c *conn) errRecover(err *error) {
512
if *err == driver.ErrBadConn {
513
c.bad = true
514
}
515
+
516
+ if c.bad && c.c != nil {
517
+ c.c.Close()
518
+ }
519
0 commit comments