diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/sources/lib.md | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/docs/sources/lib.md b/docs/sources/lib.md index c76133f9..ba481797 100644 --- a/docs/sources/lib.md +++ b/docs/sources/lib.md @@ -39,15 +39,8 @@ func main() { } // monitor the change of the peer state - if pm, err := s.NewPeerMonitor(&api.MonitorPeerRequest{}); err != nil { + if err := s.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(p *api.Peer){log.Info(p)}); err != nil { log.Fatal(err) - } else { - defer pm.Close() - go func() { - for v := range pm.Inbox { - log.Info(v) - } - }() } // neighbor configuration |