Skip to content

Commit 65be761

Browse files
committed
Fix lint issues: golines, wsl, unparam
1 parent 7353a31 commit 65be761

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

internal/council/provisioner_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@ func TestProvision_NoReprovisioning_WhenNoAvailableKing(t *testing.T) {
570570
}
571571

572572
func newTestKingWithLocation(
573-
host, ports string, bindPort int, shuttingDown bool, location string,
573+
host, ports string, bindPort int, location string,
574574
) state.King {
575575
return state.King{
576576
BindPort: bindPort,
577577
Host: host,
578578
Ports: ports,
579-
ShuttingDown: shuttingDown,
579+
ShuttingDown: false,
580580
Beat: 0,
581581
Location: location,
582582
CertPEM: "",
@@ -589,8 +589,8 @@ func TestProvisionService_PrefersMatchingLocation(t *testing.T) {
589589
currentState := &state.State{
590590
Revision: 0,
591591
Kings: []state.King{
592-
newTestKingWithLocation(testHostA, "5000-5001", 2333, false, "us-east"),
593-
newTestKingWithLocation(testHostB, "6000-6001", 2334, false, "eu-west"),
592+
newTestKingWithLocation(testHostA, "5000-5001", 2333, "us-east"),
593+
newTestKingWithLocation(testHostB, "6000-6001", 2334, "eu-west"),
594594
},
595595
Services: []state.Service{
596596
{
@@ -627,8 +627,8 @@ func TestProvisionService_FallsBackWhenPreferredLocationFull(t *testing.T) {
627627
currentState := &state.State{
628628
Revision: 0,
629629
Kings: []state.King{
630-
newTestKingWithLocation(testHostA, "5000-5001", 2333, false, "us-east"),
631-
newTestKingWithLocation(testHostB, "6000-6000", 2334, false, "eu-west"),
630+
newTestKingWithLocation(testHostA, "5000-5001", 2333, "us-east"),
631+
newTestKingWithLocation(testHostB, "6000-6000", 2334, "eu-west"),
632632
},
633633
Services: []state.Service{
634634
{

internal/ling/ling.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,11 @@ func buildKingIndex(stateSnapshot *state.State) map[string]KingIndex {
465465

466466
for _, king := range stateSnapshot.Kings {
467467
addr := net.JoinHostPort(king.Host, strconv.Itoa(king.BindPort))
468-
index[addr] = KingIndex{healthy: !king.ShuttingDown, certPEM: king.CertPEM, location: king.Location}
468+
index[addr] = KingIndex{
469+
healthy: !king.ShuttingDown,
470+
certPEM: king.CertPEM,
471+
location: king.Location,
472+
}
469473
}
470474

471475
return index
@@ -596,6 +600,7 @@ func collectProxyTargets(
596600
kings map[string]KingIndex,
597601
) []ProxyTarget {
598602
var allTargets []ProxyTarget
603+
599604
var preferredTargets []ProxyTarget
600605

601606
for _, svc := range stateSnapshot.Services {

0 commit comments

Comments
 (0)