From c5ece1d0c762af0624d4b75fae8fbb306c94b98e Mon Sep 17 00:00:00 2001 From: Louis Thibault Date: Mon, 3 Aug 2020 13:35:12 +0200 Subject: [PATCH] Add String() method to Topic. --- topic.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/topic.go b/topic.go index 9cdac5f..f4b670b 100644 --- a/topic.go +++ b/topic.go @@ -26,6 +26,11 @@ type Topic struct { closed bool } +// String returns the topic associated with t +func (t *Topic) String() string { + return t.topic +} + // EventHandler creates a handle for topic specific events // Multiple event handlers may be created and will operate independently of each other func (t *Topic) EventHandler(opts ...TopicEventHandlerOpt) (*TopicEventHandler, error) {