File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func CloseTCP(c *net.TCPConn) {
5050
5151// CloseTCPRead closes the read end of r.
5252func CloseTCPRead (r TCPConn ) {
53- if r != nil {
53+ if r != nil && IsNotNil ( r ) {
5454 // avoid expensive reflection:
5555 // groups.google.com/g/golang-nuts/c/wnH302gBa4I
5656 switch x := r .(type ) {
@@ -72,7 +72,7 @@ func CloseTCPRead(r TCPConn) {
7272
7373// CloseTCPWrite closes the write end of w.
7474func CloseTCPWrite (w TCPConn ) {
75- if w != nil {
75+ if w != nil && IsNotNil ( w ) {
7676 switch x := w .(type ) {
7777 case * net.TCPConn :
7878 if x != nil {
@@ -93,7 +93,7 @@ func CloseTCPWrite(w TCPConn) {
9393// CloseConn closes cs.
9494func CloseConn (cs ... MinConn ) {
9595 for _ , c := range cs {
96- if c == nil {
96+ if c == nil || IsNil ( c ) {
9797 continue
9898 }
9999 switch x := c .(type ) {
@@ -130,7 +130,7 @@ func Close(cs ...io.Closer) {
130130
131131// CloseOp closes op on c.
132132func CloseOp (c io.Closer , op CloserOp ) {
133- if c == nil {
133+ if c == nil || IsNil ( c ) {
134134 return
135135 }
136136 switch x := c .(type ) {
You can’t perform that action at this time.
0 commit comments