Skip to content

Commit 0a14bd7

Browse files
battlecookmaxatome
authored andcommitted
Update transport.go
remove unused matcher variable in checkMethod function
1 parent d95b1ca commit 0a14bd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

transport.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ func isRegexpURL(url string) bool {
526526
return strings.HasPrefix(url, regexpPrefix)
527527
}
528528

529-
func (m *MockTransport) checkMethod(method string, matcher Matcher) {
529+
func (m *MockTransport) checkMethod(method string) {
530530
if !m.DontCheckMethod && methodProbablyWrong(method) {
531531
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",
532532
strings.ToUpper(method),
@@ -594,7 +594,7 @@ func (m *MockTransport) checkMethod(method string, matcher Matcher) {
594594
// Note that [github.com/maxatome/tdhttpmock] provides powerful helpers
595595
// to create matchers with the help of [github.com/maxatome/go-testdeep].
596596
func (m *MockTransport) RegisterMatcherResponder(method, url string, matcher Matcher, responder Responder) {
597-
m.checkMethod(method, matcher)
597+
m.checkMethod(method)
598598

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

780780
m.registerRegexpResponder(regexpResponder{
781781
origRx: regexpPrefix + urlRegexp.String(),

0 commit comments

Comments
 (0)