Use errors.As in test
This commit is contained in:
parent
c99b664f99
commit
8ca2329ddb
@ -2,6 +2,7 @@ package soap
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@ -130,8 +131,8 @@ func TestUPnPError(t *testing.T) {
|
||||
if testing.Verbose() {
|
||||
t.Logf("%+v\n", err)
|
||||
}
|
||||
soapErr, ok := err.(*SOAPFaultError)
|
||||
if !ok {
|
||||
soapErr := &SOAPFaultError{}
|
||||
if ok := errors.As(err, &soapErr); !ok {
|
||||
t.Fatal("expected *SOAPFaultError")
|
||||
}
|
||||
if soapErr.FaultCode != "s:Client" {
|
||||
|
Loading…
Reference in New Issue
Block a user