diff -r 626c390682fc -r b4bd77d58a3e xmpp/xmpp_test.go --- a/xmpp/xmpp_test.go Sun Feb 09 09:50:38 2014 -0700 +++ b/xmpp/xmpp_test.go Sun Feb 09 09:52:28 2014 -0700 @@ -13,7 +13,8 @@ r := strings.NewReader(`` + ``) ch := make(chan interface{}) - go recvXml(r, ch, make(map[xml.Name]reflect.Type)) + cl := &Client{} + go cl.recvXml(r, ch, make(map[xml.Name]reflect.Type)) x := <-ch se, ok := x.(*streamError) if !ok { @@ -29,7 +30,7 @@ `Error text`) ch = make(chan interface{}) - go recvXml(r, ch, make(map[xml.Name]reflect.Type)) + go cl.recvXml(r, ch, make(map[xml.Name]reflect.Type)) x = <-ch se, ok = x.(*streamError) if !ok { @@ -47,7 +48,8 @@ `xmlns="` + NsClient + `" xmlns:stream="` + NsStream + `" version="1.0">`) ch := make(chan interface{}) - go recvXml(r, ch, make(map[xml.Name]reflect.Type)) + cl := &Client{} + go cl.recvXml(r, ch, make(map[xml.Name]reflect.Type)) x := <-ch ss, ok := x.(*stream) if !ok { @@ -64,9 +66,10 @@ ch := make(chan interface{}) var wg sync.WaitGroup wg.Add(1) + cl := &Client{} go func() { defer wg.Done() - sendXml(w, ch) + cl.sendXml(w, ch) }() ch <- obj close(ch)