(c *conn)
| 1093 | } |
| 1094 | |
| 1095 | func (g *connGroup) removeConn(c *conn) bool { |
| 1096 | g.mutex.Lock() |
| 1097 | defer g.mutex.Unlock() |
| 1098 | |
| 1099 | if c.timer != nil { |
| 1100 | c.timer.Stop() |
| 1101 | } |
| 1102 | |
| 1103 | for i, x := range g.idleConns { |
| 1104 | if x == c { |
| 1105 | copy(g.idleConns[i:], g.idleConns[i+1:]) |
| 1106 | n := len(g.idleConns) - 1 |
| 1107 | g.idleConns[n] = nil |
| 1108 | g.idleConns = g.idleConns[:n] |
| 1109 | return true |
| 1110 | } |
| 1111 | } |
| 1112 | |
| 1113 | return false |
| 1114 | } |
| 1115 | |
| 1116 | func (g *connGroup) releaseConn(c *conn) bool { |
| 1117 | idleTimeout := g.pool.idleTimeout |