File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func CloseTCP(c *net.TCPConn) {
50
50
51
51
// CloseTCPRead closes the read end of r.
52
52
func CloseTCPRead (r TCPConn ) {
53
- if r != nil {
53
+ if r != nil && IsNotNil ( r ) {
54
54
// avoid expensive reflection:
55
55
// groups.google.com/g/golang-nuts/c/wnH302gBa4I
56
56
switch x := r .(type ) {
@@ -72,7 +72,7 @@ func CloseTCPRead(r TCPConn) {
72
72
73
73
// CloseTCPWrite closes the write end of w.
74
74
func CloseTCPWrite (w TCPConn ) {
75
- if w != nil {
75
+ if w != nil && IsNotNil ( w ) {
76
76
switch x := w .(type ) {
77
77
case * net.TCPConn :
78
78
if x != nil {
@@ -93,7 +93,7 @@ func CloseTCPWrite(w TCPConn) {
93
93
// CloseConn closes cs.
94
94
func CloseConn (cs ... MinConn ) {
95
95
for _ , c := range cs {
96
- if c == nil {
96
+ if c == nil || IsNil ( c ) {
97
97
continue
98
98
}
99
99
switch x := c .(type ) {
@@ -130,7 +130,7 @@ func Close(cs ...io.Closer) {
130
130
131
131
// CloseOp closes op on c.
132
132
func CloseOp (c io.Closer , op CloserOp ) {
133
- if c == nil {
133
+ if c == nil || IsNil ( c ) {
134
134
return
135
135
}
136
136
switch x := c .(type ) {
You can’t perform that action at this time.
0 commit comments