MCPcopy Create free account
hub / github.com/chain/txvm / isEmpty

Function isEmpty

testutil/deepequal.go:146–158  ·  view source on GitHub ↗
(v reflect.Value)

Source from the content-addressed store, hash-verified

144}
145
146func isEmpty(v reflect.Value) bool {
147 if !v.IsValid() {
148 return true
149 }
150 switch v.Type().Kind() {
151 case reflect.Chan, reflect.Func, reflect.Interface, reflect.Ptr:
152 return v.IsNil()
153
154 case reflect.Slice, reflect.Map:
155 return v.IsNil() || v.Len() == 0
156 }
157 return false
158}
159
160func WithSort(path []string, less func(a, b interface{}) bool) func(a, b interface{}) {
161 return func(a, b interface{}) {

Callers 1

deepValueEqualFunction · 0.85

Calls 1

LenMethod · 0.45

Tested by

no test coverage detected