Package cmp provides Comparisons for Assert and Check
ResultSuccess is a constant which is returned by a ComparisonWithResult to indicate success.
Comparison is a function which compares values and returns ResultSuccess if the actual value matches the expected value. If the values do not match the Result will contain a message about why it failed.
Contains succeeds if item is in collection. Collection may be a string, map, slice, or array.
If collection is a string, item must also be a string, and is compared using strings.Contains(). If collection is a Map, contains will succeed if item is a key in the map. If collection is a slice or array, item is compared to each item in the sequence using reflect.DeepEqual().
DeepEqual compares two values using google/go-cmp (http://bit.do/go-cmp) and succeeds if the values are equal.
The comparison can be customized using comparison Options. Package https://godoc.org/gotest.tools/assert/opt provides some additional commonly used Options.
Equal succeeds if x == y. See assert.Equal for full documentation.
Error succeeds if err is a non-nil error, and the error message equals the expected message.
ErrorContains succeeds if err is a non-nil error, and the error message contains the expected substring.
ErrorType succeeds if err is not nil and is of the expected type.
Expected can be one of: a func(error) bool which returns true if the error is the expected type, an instance of (or a pointer to) a struct of the expected type, a pointer to an interface the error is expected to implement, a reflect.Type of the expected struct or interface.
Len succeeds if the sequence has the expected length.
Nil succeeds if obj is a nil interface, pointer, or function.
Use NilError() for comparing errors. Use Len(obj, 0) for comparing slices, maps, and channels.
Panics succeeds if f() panics.
Result of a Comparison.
ResultFailure returns a failed Result with a failure message.
ResultFailureTemplate returns a Result with a template string and data which can be used to format a failure message. The template may access data from .Data, the comparison args with the callArg function, and the formatNode function may be used to format the call args.
ResultFromError returns ResultSuccess if err is nil. Otherwise ResultFailure is returned with the error message as the failure message.