From c9d0b83277f591b965605fa60d5183275164e0d4 Mon Sep 17 00:00:00 2001 From: Drew Bailey <2614075+drewbailey@users.noreply.github.com> Date: Thu, 20 Feb 2020 10:03:20 -0500 Subject: [PATCH] Value is already an int, remove type cast --- agent/consul/autopilot/autopilot.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agent/consul/autopilot/autopilot.go b/agent/consul/autopilot/autopilot.go index 3e21288ed0..be0937608e 100644 --- a/agent/consul/autopilot/autopilot.go +++ b/agent/consul/autopilot/autopilot.go @@ -3,15 +3,16 @@ package autopilot import ( "context" "fmt" + "net" + "strconv" + "sync" + "time" + "github.com/hashicorp/consul/logging" "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-version" "github.com/hashicorp/raft" "github.com/hashicorp/serf/serf" - "net" - "strconv" - "sync" - "time" ) // Delegate is the interface for the Autopilot mechanism @@ -175,7 +176,7 @@ func (a *Autopilot) RemoveDeadServers() { } func canRemoveServers(peers, minQuorum, deadServers int) (bool, string) { - if peers-deadServers < int(minQuorum) { + if peers-deadServers < minQuorum { return false, fmt.Sprintf("denied, because removing %d/%d servers would leave less then minimal allowed quorum of %d servers", deadServers, peers, minQuorum) }