From fb3d1cdf0ba7142d9fea933328b425239019a52b Mon Sep 17 00:00:00 2001 From: Alexander Emelin Date: Sun, 26 May 2024 18:37:55 +0300 Subject: [PATCH] cleanups --- _examples/document_sync/main.go | 21 --------------------- broker_redis_test.go | 6 +++--- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/_examples/document_sync/main.go b/_examples/document_sync/main.go index c4910fd9..ff0d26a3 100644 --- a/_examples/document_sync/main.go +++ b/_examples/document_sync/main.go @@ -80,27 +80,6 @@ func main() { LogHandler: handleLog, }) - redisShardConfigs := []centrifuge.RedisShardConfig{ - {Address: "localhost:6379"}, - } - var redisShards []*centrifuge.RedisShard - for _, redisConf := range redisShardConfigs { - redisShard, err := centrifuge.NewRedisShard(node, redisConf) - if err != nil { - log.Fatal(err) - } - redisShards = append(redisShards, redisShard) - } - - broker, err := centrifuge.NewRedisBroker(node, centrifuge.RedisBrokerConfig{ - // And configure a couple of shards to use. - Shards: redisShards, - }) - if err != nil { - log.Fatal(err) - } - node.SetBroker(broker) - node.OnConnect(func(client *centrifuge.Client) { transport := client.Transport() log.Printf("user %s connected via %s with protocol: %s", client.UserID(), transport.Name(), transport.Protocol()) diff --git a/broker_redis_test.go b/broker_redis_test.go index df30d9a7..c88ab2d6 100644 --- a/broker_redis_test.go +++ b/broker_redis_test.go @@ -1965,13 +1965,13 @@ func TestParseDeltaPush(t *testing.T) { name string input string expectError bool - expectedResult *deltaPublicationPush + expectedResult deltaPublicationPush }{ { name: "valid data with colon in payload", input: "d1:1234567890:epoch1:4:test:18:payload:with:colon", expectError: false, - expectedResult: &deltaPublicationPush{ + expectedResult: deltaPublicationPush{ Offset: 1234567890, Epoch: "epoch1", PrevPayloadLength: 4, @@ -1984,7 +1984,7 @@ func TestParseDeltaPush(t *testing.T) { name: "valid data with empty payload", input: "d1:1234567890:epoch2:0::0:", expectError: false, - expectedResult: &deltaPublicationPush{ + expectedResult: deltaPublicationPush{ Offset: 1234567890, Epoch: "epoch2", PrevPayloadLength: 0,