5 "github.com/onsi/gomega/format"
8 type BeEmptyMatcher struct {
11 func (matcher *BeEmptyMatcher) Match(actual interface{}) (success bool, err error) {
12 length, ok := lengthOf(actual)
14 return false, fmt.Errorf("BeEmpty matcher expects a string/array/map/channel/slice. Got:\n%s", format.Object(actual, 1))
17 return length == 0, nil
20 func (matcher *BeEmptyMatcher) FailureMessage(actual interface{}) (message string) {
21 return format.Message(actual, "to be empty")
24 func (matcher *BeEmptyMatcher) NegatedFailureMessage(actual interface{}) (message string) {
25 return format.Message(actual, "not to be empty")