From f63292cc48fe88c2710858d6cb0920949f7ebc0b Mon Sep 17 00:00:00 2001 From: Fran Bull Date: Mon, 17 Mar 2025 12:18:07 -0700 Subject: [PATCH] useless elses --- tsconsensus/tsconsensus.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tsconsensus/tsconsensus.go b/tsconsensus/tsconsensus.go index dbb826e29..6cca024ee 100644 --- a/tsconsensus/tsconsensus.go +++ b/tsconsensus/tsconsensus.go @@ -284,20 +284,19 @@ func (c *Consensus) bootstrap(targets views.Slice[*ipnstate.PeerStatus]) error { for _, p := range targets.All() { if !p.Online { log.Printf("Trying to find cluster: tailscale reports not online: %s", p.TailscaleIPs[0]) - } else { - log.Printf("Trying to find cluster: trying %s", p.TailscaleIPs[0]) - err := c.commandClient.join(p.TailscaleIPs[0].String(), joinRequest{ - RemoteHost: c.self.hostAddr.String(), - RemoteID: c.self.id, - }) - if err != nil { - log.Printf("Trying to find cluster: could not join %s: %v", p.TailscaleIPs[0], err) - continue - } else { - log.Printf("Trying to find cluster: joined %s", p.TailscaleIPs[0]) - return nil - } + continue } + log.Printf("Trying to find cluster: trying %s", p.TailscaleIPs[0]) + err := c.commandClient.join(p.TailscaleIPs[0].String(), joinRequest{ + RemoteHost: c.self.hostAddr.String(), + RemoteID: c.self.id, + }) + if err != nil { + log.Printf("Trying to find cluster: could not join %s: %v", p.TailscaleIPs[0], err) + continue + } + log.Printf("Trying to find cluster: joined %s", p.TailscaleIPs[0]) + return nil } log.Printf("Trying to find cluster: unsuccessful, starting as leader: %s", c.self.hostAddr.String())