From b13d0baad048e8772fba196652990db419fad534 Mon Sep 17 00:00:00 2001 From: Matt Goodall Date: Mon, 9 Jul 2012 13:27:49 +0100 Subject: [PATCH] Simplify error creation. --- src/xmpp/stream.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xmpp/stream.go b/src/xmpp/stream.go index 6852259..a1f597f 100644 --- a/src/xmpp/stream.go +++ b/src/xmpp/stream.go @@ -4,7 +4,6 @@ import ( "bytes" "crypto/tls" "encoding/xml" - "errors" "fmt" "log" "net" @@ -106,7 +105,7 @@ func (stream *Stream) Next(match *xml.Name) (*xml.StartElement, error) { } if e, ok := t.(xml.StartElement); ok { if match != nil && e.Name != *match { - return nil, errors.New(fmt.Sprintf("Expected %s, got %s", *match, e.Name)) + return nil, fmt.Errorf("Expected %s, got %s", *match, e.Name) } return &e, nil }