Skip to content

Commit

Permalink
Update transport.go
Browse files Browse the repository at this point in the history
remove unused matcher variable in checkMethod function
  • Loading branch information
battlecook authored and maxatome committed Jun 24, 2024
1 parent d95b1ca commit 0a14bd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func isRegexpURL(url string) bool {
return strings.HasPrefix(url, regexpPrefix)
}

func (m *MockTransport) checkMethod(method string, matcher Matcher) {
func (m *MockTransport) checkMethod(method string) {
if !m.DontCheckMethod && methodProbablyWrong(method) {
panic(fmt.Sprintf("You probably want to use method %q instead of %q? If not and so want to disable this check, set MockTransport.DontCheckMethod field to true",
strings.ToUpper(method),
Expand Down Expand Up @@ -594,7 +594,7 @@ func (m *MockTransport) checkMethod(method string, matcher Matcher) {
// Note that [github.com/maxatome/tdhttpmock] provides powerful helpers
// to create matchers with the help of [github.com/maxatome/go-testdeep].
func (m *MockTransport) RegisterMatcherResponder(method, url string, matcher Matcher, responder Responder) {
m.checkMethod(method, matcher)
m.checkMethod(method)

mr := matchResponder{
matcher: matcher,
Expand Down Expand Up @@ -775,7 +775,7 @@ found:
// Note that [github.com/maxatome/tdhttpmock] provides powerful helpers
// to create matchers with the help of [github.com/maxatome/go-testdeep].
func (m *MockTransport) RegisterRegexpMatcherResponder(method string, urlRegexp *regexp.Regexp, matcher Matcher, responder Responder) {
m.checkMethod(method, matcher)
m.checkMethod(method)

m.registerRegexpResponder(regexpResponder{
origRx: regexpPrefix + urlRegexp.String(),
Expand Down

0 comments on commit 0a14bd7

Please sign in to comment.