(p EndpointPattern)
| 692 | type MockBackendOption func(map[string]http.HandlerFunc) |
| 693 | |
| 694 | func parseEndpointPattern(p EndpointPattern) (string, string) { |
| 695 | parts := strings.SplitN(string(p), " ", 2) |
| 696 | if len(parts) != 2 { |
| 697 | return http.MethodGet, string(p) |
| 698 | } |
| 699 | return parts[0], parts[1] |
| 700 | } |
| 701 | |
| 702 | func WithRequestMatch(pattern EndpointPattern, response any) MockBackendOption { |
| 703 | return func(handlers map[string]http.HandlerFunc) { |
no outgoing calls
no test coverage detected