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/09/22 05:51:49 UTC

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

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


##########
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:
   This is a private function, we ensure the client is not nil. If the client is nil, I think panic is acceptable.



-- 
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