From cb8190ccd770bd55e511b9c04f70d508a29f4408 Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Wed, 14 Aug 2013 13:03:16 -0400 Subject: [PATCH] tweak broker example --- broker_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/broker_test.go b/broker_test.go index 9b2fae08a..23dd573f8 100644 --- a/broker_test.go +++ b/broker_test.go @@ -145,14 +145,16 @@ func ExampleBroker() error { if err != nil { return err } + defer broker.Close() request := MetadataRequest{Topics: []string{"myTopic"}} response, err := broker.GetMetadata("myClient", &request) + if err != nil { + return err + } fmt.Println("There are", len(response.Topics), "topics active in the cluster.") - broker.Close() - return nil }