func GetMatchValue(ctx *context.Context, selector string, reqParams map[string]interface{}, decoded interface{}) (interface{}, error) {
	parts := strings.Split(selector, "#")
	base := parts[0]
	args := strings.Join(parts[1:], "#")
	l := log.Debug().Str("selector", base)
	if args != "" {
		l = l.Str("query", args)
	}
	var actual interface{}
	switch base {
	case "request.param":
		actual = reqParams[args]
	case "request.body":
		var decoded interface{}
		if err := UnmarshalRequest(ctx, &decoded); err != nil {
			return nil, err
		}
		result, err := jmespath.Search(args, decoded)
		if err != nil {
			return nil, err
		}
		actual = result
	case "response.status":
		actual = ctx.Response.StatusCode
	case "response.header":
		actual = ctx.Response.Header.Get(args)
	case "response.body":
		result, err := jmespath.Search(args, decoded)
		if err != nil {
			return nil, err
		}
		actual = result
	default:
		return false, fmt.Errorf("Cannot match selector: %s", selector)
	}
	l.Interface("actual", actual).Msg("Found matcher value")
	return actual, nil
}
GetMatchValue returns a value for the given selector query.
package cli
import (
	"bytes"
	"encoding/json"
	"fmt"
	"reflect"
	"strings"
	jmespath "github.com/danielgtaylor/go-jmespath-plus"
	"github.com/rs/zerolog/log"
	"gopkg.in/h2non/gentleman.v2/context"
)
func objectsAreEqual(expected, actual interface{}) bool {
	if expected == nil || actual == nil {
		return expected == actual
	}
	exp, ok := expected.([]byte)
	if !ok {
		return reflect.DeepEqual(expected, actual)
	}
	act, ok := actual.([]byte)
	if !ok {
		return false
	}
	if exp == nil || act == nil {
		return exp == nil && act == nil
	}
	return bytes.Equal(exp, act)
}
func objectsAreEqualValues(expected, actual interface{}) bool {
	if objectsAreEqual(expected, actual) {
		return true
	}
	actualType := reflect.TypeOf(actual)
	if actualType == nil {
		return false
	}
	expectedValue := reflect.ValueOf(expected)
	if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) {
		return reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual)
	}
	return false
}