func DottedFind(key string, o map[string]interface{}) (interface{}, error) {
	val, err := jsonpath.JsonPathLookup(o, "$."+key)
	if IsJSONPathNotFound(err) || IsJSONPathNil(val) {
		return nil, nil
	}
	return val, nil
}
DottedFind will attempt to look for a dotted key such as a.b.c in {"a":{"b":{"c": true}}}
package json
import (
	"fmt"
	"regexp"
	"strings"
	"time"
	"github.com/oliveagle/jsonpath"
	"github.com/pinpt/go-common/v10/datetime"
	"github.com/pinpt/go-common/v10/hash"
)
type Action func(args ...interface{}) (interface{}, error)
var (
	actionRe = regexp.MustCompile("^(\\w+)\\((.*)\\)$")
	actions  = make(map[string]Action)
)
func RegisterAction(name string, action Action) {
	actions[name] = action
}
func IsJSONPathNil(val interface{}) bool {
	return val == nil
}
func IsJSONPathNotFound(err error) bool {
	return err != nil && (strings.Contains(err.Error(), "not found in object") ||
		strings.Contains(err.Error(), "get attribute from null object"))
}