1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 10:49:24 +08:00

fix: multiconn s/Conns()/getConns()

@jbenet

must be getConns to avoid clash with private var

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow
2014-12-05 20:54:31 -08:00
parent 697453dfc2
commit f870948274
2 changed files with 3 additions and 3 deletions

View File

@ -262,7 +262,7 @@ func (c *MultiConn) ID() string {
return string(ids) return string(ids)
} }
func (c *MultiConn) Conns() []Conn { func (c *MultiConn) getConns() []Conn {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()
var conns []Conn var conns []Conn

View File

@ -307,11 +307,11 @@ func TestMulticonnClose(t *testing.T) {
ctx := context.Background() ctx := context.Background()
c1, c2 := setupMultiConns(t, ctx) c1, c2 := setupMultiConns(t, ctx)
for _, c := range c1.Conns() { for _, c := range c1.getConns() {
c.Close() c.Close()
} }
for _, c := range c2.Conns() { for _, c := range c2.getConns() {
c.Close() c.Close()
} }