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