func ShouldNotAlmostEqual(actual interface{}, expected ...interface{}) error {
	if err := need(2, expected); err != nil {
		return err
	}
	actualF, err := cast.ToFloat64E(actual)
	if err != nil {
		return err
	}
	expectedF, err := cast.ToFloat64E(expected[0])
	if err != nil {
		return err
	}
	deltaF, err := cast.ToFloat64E(expected[1])
	if err != nil {
		return err
	}
	if math.Abs(actualF-expectedF) >= deltaF {
		return nil
	}
	return fmt.Errorf("not expected: %v(+/- %v) got: %v (%v)", expected[0], expected[1], actual, math.Abs(actualF-expectedF))
}
ShouldNotAlmostEqual makes sure that two parameters are not close enough to being equal.
The unacceptable delta may be specified with a third argument.
package assertions
import (
	"fmt"
	"math"
	"reflect"
	"strings"
	"time"
	"github.com/pkg/errors"
	"github.com/spf13/cast"
)
type AssertFunc func(actual interface{}, expected ...interface{}) error
var assertMap = map[string]AssertFunc{
	"ShouldEqual":                  ShouldEqual,
	"ShouldNotEqual":               ShouldNotEqual,
	"ShouldAlmostEqual":            ShouldAlmostEqual,
	"ShouldNotAlmostEqual":         ShouldNotAlmostEqual,
	"ShouldNotExist":               ShouldNotExist,
	"ShouldBeNil":                  ShouldBeNil,
	"ShouldNotBeNil":               ShouldNotBeNil,
	"ShouldBeTrue":                 ShouldBeTrue,
	"ShouldBeFalse":                ShouldBeFalse,
	"ShouldBeZeroValue":            ShouldBeZeroValue,
	"ShouldBeGreaterThan":          ShouldBeGreaterThan,
	"ShouldBeGreaterThanOrEqualTo": ShouldBeGreaterThanOrEqualTo,
	"ShouldBeLessThan":             ShouldBeLessThan,
	"ShouldBeLessThanOrEqualTo":    ShouldBeLessThanOrEqualTo,
	"ShouldBeBetween":              ShouldBeBetween,
	"ShouldNotBeBetween":           ShouldNotBeBetween,
	"ShouldBeBetweenOrEqual":       ShouldBeBetweenOrEqual,
	"ShouldNotBeBetweenOrEqual":    ShouldNotBeBetweenOrEqual,
	"ShouldContain":                ShouldContain,
	"ShouldNotContain":             ShouldNotContain,
	"ShouldContainKey":             ShouldContainKey,
	"ShouldNotContainKey":          ShouldNotContainKey,
	"ShouldBeIn":                   ShouldBeIn,
	"ShouldNotBeIn":                ShouldNotBeIn,
	"ShouldBeEmpty":                ShouldBeEmpty,
	"ShouldNotBeEmpty":             ShouldNotBeEmpty,
	"ShouldHaveLength":             ShouldHaveLength,
	"ShouldStartWith":              ShouldStartWith,
	"ShouldNotStartWith":           ShouldNotStartWith,
	"ShouldEndWith":                ShouldEndWith,
	"ShouldNotEndWith":             ShouldNotEndWith,
	"ShouldBeBlank":                ShouldBeBlank,
	"ShouldNotBeBlank":             ShouldNotBeBlank,
	"ShouldContainSubstring":       ShouldContainSubstring,
	"ShouldNotContainSubstring":    ShouldNotContainSubstring,
	"ShouldEqualTrimSpace":         ShouldEqualTrimSpace,
	"ShouldHappenBefore":           ShouldHappenBefore,
	"ShouldHappenOnOrBefore":       ShouldHappenOnOrBefore,
	"ShouldHappenAfter":            ShouldHappenAfter,
	"ShouldHappenOnOrAfter":        ShouldHappenOnOrAfter,
	"ShouldHappenBetween":          ShouldHappenBetween,
}
func Get(s string) (AssertFunc, bool) {
	f, ok := assertMap[s]
	return f, ok
}
func deepEqual(x, y interface{}) bool {
	if !reflect.DeepEqual(x, y) {
		return fmt.Sprintf("%v", x) == fmt.Sprintf("%v", y)
	}
	return true
}
func ShouldEqual(actual interface{}, expected ...interface{}) error {
	if len(expected) > 0 {
		var args string
		for i := range expected {
			actualS, err := cast.ToStringE(expected[i])
			if err != nil {
				return err
			}
			args += actualS + " "
		}
		if deepEqual(actual, strings.TrimRight(args, " ")) {
			return nil
		}
		return fmt.Errorf("expected: %v got: %v", args, actual)
	}
	if err := need(1, expected); err != nil {
		return err
	}
	if deepEqual(actual, expected[0]) {
		return nil
	}
	return fmt.Errorf("expected: %v got: %v", expected[0], actual)
}
func ShouldNotEqual(actual interface{}, expected ...interface{}) error {
	if err := ShouldEqual(actual, expected...); err == nil {
		return fmt.Errorf("not expected: %v got: %v", expected[0], actual)
	}
	return nil
}
func ShouldAlmostEqual(actual interface{}, expected ...interface{}) error {
	if err := need(2, expected); err != nil {
		return err
	}
	actualF, err := cast.ToFloat64E(actual)
	if err != nil {
		return err
	}
	expectedF, err := cast.ToFloat64E(expected[0])
	if err != nil {
		return err
	}
	deltaF, err := cast.ToFloat64E(expected[1])
	if err != nil {
		return err
	}
	actualDeltaF := math.Abs(actualF - expectedF)
	if actualDeltaF <= deltaF {
		return nil
	}
	return fmt.Errorf("expected: %v(+/- %v) got: %v (%v)", expectedF, deltaF, actualF, actualDeltaF)
}