Skip to content

Commit 7131afe

Browse files
committed
Update docs, fix lint
1 parent 75b2f0d commit 7131afe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tailnet/conn.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,15 @@ func (c *Conn) RemoveAllPeers() error {
364364
}
365365

366366
// UpdateNodes connects with a set of peers. This can be constantly updated,
367-
// and peers will continually be reconnected as necessary.
368-
func (c *Conn) UpdateNodes(nodes []*Node, replace bool) error {
367+
// and peers will continually be reconnected as necessary. If replacePeers is
368+
// true, all peers will be removed before adding the new ones.
369+
//
370+
//nolint:revive // Complains about replacePeers.
371+
func (c *Conn) UpdateNodes(nodes []*Node, replacePeers bool) error {
369372
c.mutex.Lock()
370373
defer c.mutex.Unlock()
371374
status := c.Status()
372-
if replace {
375+
if replacePeers {
373376
c.netMap.Peers = []*tailcfg.Node{}
374377
c.peerMap = map[tailcfg.NodeID]*tailcfg.Node{}
375378
}

0 commit comments

Comments
 (0)