Simplify error creation.

This commit is contained in:
Matt Goodall 2012-07-09 13:27:49 +01:00
parent 7a91f5d8ea
commit b13d0baad0
1 changed files with 1 additions and 2 deletions

View File

@ -4,7 +4,6 @@ import (
"bytes" "bytes"
"crypto/tls" "crypto/tls"
"encoding/xml" "encoding/xml"
"errors"
"fmt" "fmt"
"log" "log"
"net" "net"
@ -106,7 +105,7 @@ func (stream *Stream) Next(match *xml.Name) (*xml.StartElement, error) {
} }
if e, ok := t.(xml.StartElement); ok { if e, ok := t.(xml.StartElement); ok {
if match != nil && e.Name != *match { 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 return &e, nil
} }