Value is already an int, remove type cast

This commit is contained in:
Drew Bailey 2020-02-20 10:03:20 -05:00 committed by Daniel Nephin
parent 770fa971d4
commit c9d0b83277
1 changed files with 6 additions and 5 deletions

View File

@ -3,15 +3,16 @@ package autopilot
import ( import (
"context" "context"
"fmt" "fmt"
"net"
"strconv"
"sync"
"time"
"github.com/hashicorp/consul/logging" "github.com/hashicorp/consul/logging"
"github.com/hashicorp/go-hclog" "github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-version" "github.com/hashicorp/go-version"
"github.com/hashicorp/raft" "github.com/hashicorp/raft"
"github.com/hashicorp/serf/serf" "github.com/hashicorp/serf/serf"
"net"
"strconv"
"sync"
"time"
) )
// Delegate is the interface for the Autopilot mechanism // Delegate is the interface for the Autopilot mechanism
@ -175,7 +176,7 @@ func (a *Autopilot) RemoveDeadServers() {
} }
func canRemoveServers(peers, minQuorum, deadServers int) (bool, string) { 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) return false, fmt.Sprintf("denied, because removing %d/%d servers would leave less then minimal allowed quorum of %d servers", deadServers, peers, minQuorum)
} }