From c197c2a820e9b483e9a2b10d8b513a79362274b1 Mon Sep 17 00:00:00 2001 From: Lorenzo Alberton Date: Mon, 21 Mar 2016 17:41:02 +0000 Subject: [PATCH] pre-allocate error message --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 280d0da..baca651 100644 --- a/client.go +++ b/client.go @@ -210,7 +210,7 @@ func (c *StatsdClient) SendEvent(e event.Event) error { // Tries to bundle many together into one fmt.Fprintf based on UDPPayloadSize. func (c *StatsdClient) SendEvents(events map[string]event.Event) error { if c.conn == nil { - return fmt.Errorf("cannot send stats, not connected to StatsD server") + return errNotConnected } var n int