Skip to content

Commit

Permalink
Use errors.As in test
Browse files Browse the repository at this point in the history
  • Loading branch information
jybp authored and huin committed May 10, 2023
1 parent c99b664 commit 8ca2329
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions soap/soap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package soap

import (
"bytes"
"errors"
"io/ioutil"
"net/http"
"net/url"
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit 8ca2329

Please sign in to comment.