func MatchQueryParams(req *http.Request, ereq *Request) (bool, error) {
	for key, value := range ereq.URLStruct.Query() {
		var err error
		var match bool
		for _, field := range req.URL.Query()[key] {
			match, err = regexp.MatchString(value[0], field)
			if err != nil {
				return false, err
			}
			if match {
				break
			}
		}
		if !match {
			return false, nil
		}
	}
	return true, nil
}
MatchQueryParams matches the URL query params fields of the given request.
package gock
import (
	"compress/gzip"
	"encoding/json"
	"io"
	"io/ioutil"
	"net/http"
	"reflect"
	"regexp"
	"strings"
	"github.com/h2non/parth"
)
const EOL = 0xa
var BodyTypes = []string{
	"text/html",
	"text/plain",
	"application/json",
	"application/xml",
	"multipart/form-data",
	"application/x-www-form-urlencoded",
}
var BodyTypeAliases = map[string]string{
	"html": "text/html",
	"text": "text/plain",
	"json": "application/json",
	"xml":  "application/xml",
	"form": "multipart/form-data",
	"url":  "application/x-www-form-urlencoded",
}
var CompressionSchemes = []string{
	"gzip",
}
func MatchMethod(req *http.Request, ereq *Request) (bool, error) {
	return ereq.Method == "" || req.Method == ereq.Method, nil
}
func MatchScheme(req *http.Request, ereq *Request) (bool, error) {
	return ereq.URLStruct.Scheme == "" || req.URL.Scheme == "" || ereq.URLStruct.Scheme == req.URL.Scheme, nil
}
func MatchHost(req *http.Request, ereq *Request) (bool, error) {
	url := ereq.URLStruct
	if strings.EqualFold(url.Host, req.URL.Host) {
		return true, nil
	}
	if !ereq.Options.DisableRegexpHost {
		return regexp.MatchString(url.Host, req.URL.Host)
	}
	return false, nil
}
func MatchPath(req *http.Request, ereq *Request) (bool, error) {
	if req.URL.Path == ereq.URLStruct.Path {
		return true, nil
	}
	return regexp.MatchString(ereq.URLStruct.Path, req.URL.Path)
}
func MatchHeaders(req *http.Request, ereq *Request) (bool, error) {
	for key, value := range ereq.Header {
		var err error
		var match bool
		var matchEscaped bool
		for _, field := range req.Header[key] {
			match, err = regexp.MatchString(value[0], field)
			matchEscaped, err = regexp.MatchString(regexp.QuoteMeta(value[0]), field)
			if err != nil {
				return false, err
			}
			if match || matchEscaped {
				break
			}
		}
		if !match && !matchEscaped {
			return false, nil
		}
	}
	return true, nil
}