From f870948274cc4c1e0b4dc7c650955df857567d17 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Fri, 5 Dec 2014 20:54:31 -0800 Subject: [PATCH] fix: multiconn s/Conns()/getConns() @jbenet must be getConns to avoid clash with private var License: MIT Signed-off-by: Brian Tiger Chow --- net/conn/multiconn.go | 2 +- net/conn/multiconn_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/conn/multiconn.go b/net/conn/multiconn.go index c5b3feafe..01b91c6b1 100644 --- a/net/conn/multiconn.go +++ b/net/conn/multiconn.go @@ -262,7 +262,7 @@ func (c *MultiConn) ID() string { return string(ids) } -func (c *MultiConn) Conns() []Conn { +func (c *MultiConn) getConns() []Conn { c.RLock() defer c.RUnlock() var conns []Conn diff --git a/net/conn/multiconn_test.go b/net/conn/multiconn_test.go index 77aee9a8f..03ed2e369 100644 --- a/net/conn/multiconn_test.go +++ b/net/conn/multiconn_test.go @@ -307,11 +307,11 @@ func TestMulticonnClose(t *testing.T) { ctx := context.Background() c1, c2 := setupMultiConns(t, ctx) - for _, c := range c1.Conns() { + for _, c := range c1.getConns() { c.Close() } - for _, c := range c2.Conns() { + for _, c := range c2.getConns() { c.Close() }