From c98c5f0eebf8d254307183c2ce702a48256b718d Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sat, 4 Jun 2022 16:20:10 +0300 Subject: [PATCH] fix: update ChannelWithSubscriptions to accept options --- go.mod | 1 - go.sum | 1 - pubsub.go | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index fdf1076b..36eb8010 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.17 require ( github.com/cespare/xxhash/v2 v2.1.2 - github.com/davecgh/go-spew v1.1.1 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.19.0 diff --git a/go.sum b/go.sum index 53adb179..dfa31aac 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,6 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= diff --git a/pubsub.go b/pubsub.go index efc2354a..3df2d65d 100644 --- a/pubsub.go +++ b/pubsub.go @@ -456,9 +456,9 @@ func (c *PubSub) ChannelSize(size int) <-chan *Message { // reconnections. // // ChannelWithSubscriptions can not be used together with Channel or ChannelSize. -func (c *PubSub) ChannelWithSubscriptions(_ context.Context, size int) <-chan interface{} { +func (c *PubSub) ChannelWithSubscriptions(opts ...ChannelOption) <-chan interface{} { c.chOnce.Do(func() { - c.allCh = newChannel(c, WithChannelSize(size)) + c.allCh = newChannel(c, opts...) c.allCh.initAllChan() }) if c.allCh == nil {