Skip to content

Commit

Permalink
Fix vet
Browse files Browse the repository at this point in the history
  • Loading branch information
arjan-bal committed Aug 9, 2024
1 parent 747bd8a commit 84194db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 0 additions & 10 deletions balancer/pickfirst_leaf/pickfirst_leaf.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ import (
"google.golang.org/grpc/serviceconfig"
)

const (
subConnListConnecting uint32 = iota
subConnListConnected
subConnListClosed
)

func init() {
balancer.Register(pickfirstBuilder{name: PickFirstLeafName})
if envconfig.NewPickFirstEnabled {
Expand Down Expand Up @@ -634,7 +628,3 @@ func (i *index) seekTo(needle *resolver.Address) bool {
}
return false
}

func (i *index) size() int {
return len(i.endpointList)
}
12 changes: 6 additions & 6 deletions test/pickfirst_leaf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ func (s) TestPickFirstLeaf_ResolverUpdate(t *testing.T) {

// shutdown all active backends except the target.
var targetAddr resolver.Address
for idx_i, idx := range tc.initialBackendIndexes {
for idxI, idx := range tc.initialBackendIndexes {
if idx == tc.initialTargetBackendIndex {
targetAddr = addrs[idx_i]
targetAddr = addrs[idxI]
continue
}
backends[idx].S.Stop()
Expand All @@ -243,7 +243,7 @@ func (s) TestPickFirstLeaf_ResolverUpdate(t *testing.T) {
t.Fatal(err)
}
bal := <-balChan
scs := bal.scStates
scs := bal.subConns()

if got, want := len(scs), len(tc.wantScStates); got != want {
t.Fatalf("len(subconns) = %d, want %d", got, want)
Expand Down Expand Up @@ -278,9 +278,9 @@ func (s) TestPickFirstLeaf_ResolverUpdate(t *testing.T) {
r.UpdateState(resolver.State{Addresses: addrs})

// shutdown all active backends except the target.
for idx_i, idx := range tc.updatedBackendIndexes {
for idxI, idx := range tc.updatedBackendIndexes {
if idx == tc.updatedTargetBackendIndex {
targetAddr = addrs[idx_i]
targetAddr = addrs[idxI]
continue
}
backends[idx].S.Stop()
Expand All @@ -289,7 +289,7 @@ func (s) TestPickFirstLeaf_ResolverUpdate(t *testing.T) {
if err := pickfirst.CheckRPCsToBackend(ctx, cc, targetAddr); err != nil {
t.Fatal(err)
}
scs = bal.scStates
scs = bal.subConns()

if got, want := len(scs), len(tc.wantScStatesPostUpdate); got != want {
t.Fatalf("len(subconns) = %d, want %d", got, want)
Expand Down

0 comments on commit 84194db

Please sign in to comment.