diff --git a/pkg/redis/server/pool.go b/pkg/redis/server/pool.go index 56521f5c..d4524a3b 100644 --- a/pkg/redis/server/pool.go +++ b/pkg/redis/server/pool.go @@ -62,17 +62,6 @@ func (pool *ServerPool) GetServer(connectionString string, alias *string) (*Serv return srv, nil } -func (pool *ServerPool) indexByAlias() map[string]*Server { - index := make(map[string]*Server, len(pool.servers)) - for _, srv := range pool.servers { - if srv.alias != "" { - index[srv.alias] = srv - } - } - - return index -} - func (pool *ServerPool) indexByHostPort() map[string]*Server { index := make(map[string]*Server, len(pool.servers)) for _, srv := range pool.servers { diff --git a/pkg/redis/server/pool_test.go b/pkg/redis/server/pool_test.go index f74c1734..f68691c7 100644 --- a/pkg/redis/server/pool_test.go +++ b/pkg/redis/server/pool_test.go @@ -88,40 +88,6 @@ func TestServerPool_GetServer(t *testing.T) { }) } -func TestServerPool_indexByAlias(t *testing.T) { - type fields struct { - servers []*Server - } - tests := []struct { - name string - fields fields - want map[string]*Server - }{ - { - name: "Returns a map indexed by host", - fields: fields{ - servers: []*Server{ - {alias: "host1", client: nil, host: "127.0.0.1", port: "1000"}, - {alias: "host2", client: nil, host: "127.0.0.2", port: "2000"}, - }, - }, - want: map[string]*Server{ - "host1": {alias: "host1", client: nil, host: "127.0.0.1", port: "1000"}, - "host2": {alias: "host2", client: nil, host: "127.0.0.2", port: "2000"}, - }, - }} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - pool := &ServerPool{ - servers: tt.fields.servers, - } - if got := pool.indexByAlias(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("ServerPool.indexByAlias() = %v, want %v", got, tt.want) - } - }) - } -} - func TestServerPool_indexByHost(t *testing.T) { type fields struct { servers []*Server