You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/10 19:00:30 UTC

[GitHub] [pulsar-client-go] zzzming commented on a diff in pull request #848: [client] rewrite regexConsumer to avoid duplicate code

zzzming commented on code in PR #848:
URL: https://github.com/apache/pulsar-client-go/pull/848#discussion_r991568581


##########
pulsar/consumer_regex.go:
##########
@@ -360,13 +235,13 @@ func (c *regexConsumer) unsubscribe(topics []string) {
 	}
 }
 
-func (c *regexConsumer) topics() ([]string, error) {
-	topics, err := c.client.lookupService.GetTopicsOfNamespace(c.namespace, internal.Persistent)
+func topics(client *client, namespace string, pattern *regexp.Regexp) ([]string, error) {
+	topics, err := client.lookupService.GetTopicsOfNamespace(namespace, internal.Persistent)

Review Comment:
   Can we make this function as part of struct method? So that client would not be nil. 
   func (c *regexConsumer) topics() ..{
     topics, err: =c.client
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org