func ToBool(v interface{}, k string) (bool, error) {
	switch typedV := v.(type) {
	case bool:
		return typedV, nil
	}
	return false, fmt.Errorf("%s should be a json boolean, not a %T", k, v)
}
coerce interface{} to bool
package typeutils
import (
	"fmt"
)
func ToStringSlice(v interface{}, k string) ([]string, error) {
	ret := []string{}
	switch typedV := v.(type) {
	case []interface{}:
		for _, i := range typedV {
			ret = append(ret, i.(string))
		}
		return ret, nil
	}
	return ret, fmt.Errorf("%s should be a json array, not a %T", k, v)
}
func ToString(v interface{}, k string) (string, error) {
	switch typedV := v.(type) {
	case string:
		return typedV, nil
	}
	return "", fmt.Errorf("%s should be a json string, not a %T", k, v)
}