You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the requirement of maintaining a single *pubsub.Topic handle per pubsub topic, it is often helpful to identify the topic to which a given handle belongs.
Common solutions include:
map[string]*topic.Topic
Defining a local topic handle that embeds *topic.Topic, and exposes the topic string via a String() string method
Seeing as how *topic.Topic already contains an unexported topic field, it would be both trivial and extremely helpful to add the following method:
func (t*Topic) String() string {
returnt.topic
}
I'm happy to submit a PR if there's any interest.
The text was updated successfully, but these errors were encountered:
Due to the requirement of maintaining a single
*pubsub.Topic
handle per pubsub topic, it is often helpful to identify the topic to which a given handle belongs.Common solutions include:
map[string]*topic.Topic
*topic.Topic
, and exposes the topic string via aString() string
methodSeeing as how
*topic.Topic
already contains an unexportedtopic
field, it would be both trivial and extremely helpful to add the following method:I'm happy to submit a PR if there's any interest.
The text was updated successfully, but these errors were encountered: