Use errors.As in test

This commit is contained in:
jybp 2023-05-10 16:52:26 +02:00 committed by Huin
parent c99b664f99
commit 8ca2329ddb

View File

@ -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" {