examples: fix unresponsive pubsub chat example
@@ -121,10 +121,8 @@ func (ui *ChatUI) end() {
func (ui *ChatUI) refreshPeers() {
peers := ui.cr.ListPeers()
- // clear is not threadsafe so we need to take the lock.
- ui.peersList.Lock()
+ // clear is thread-safe
ui.peersList.Clear()
- ui.peersList.Unlock()
for _, p := range peers {
fmt.Fprintln(ui.peersList, shortID(p))
