// isZero shallowly check wether a field in struct is zero or not
504104
func isZero(rv reflect.Value) bool {
	zero := true
	switch rv.Kind() {
	case reflect.Bool:
		zero = !rv.Bool()
	case reflect.Float32, reflect.Float64:
		zero = rv.Float() == 0
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		zero = rv.Int() == 0
	case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
		zero = rv.IsNil()
	case reflect.String:
		zero = rv.String() == ""
	case reflect.Uint, reflect.Uintptr, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		zero = rv.Uint() == 0
	}

	return zero
}
131900
func isNot(lhs Expression, val interface{}) BooleanExpression {
	return checkBoolExpType(IS_OP, lhs, val, true)
}
1312325
func (b Box) IsZero() bool {
	if b.IsSet {
		return false
	}
	return b.Top == 0 && b.Left == 0 && b.Right == 0 && b.Bottom == 0
}
1188688
func Zero(typ types.Type) string {
	switch t := typ.(type) {
	case *types.Basic:
		switch t.Kind() {
		case types.String:
			return `""`
		case types.Bool:
			return "false"
		default:
			return "0"
		}
	}
	return "nil"
}
1184050
func (c *cState) encodeZero(symbolTT symbolTransform) {
	nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16
	dstState := int32(c.state>>(nbBitsOut&15)) + symbolTT.deltaFindState
	c.bw.addBits16ZeroNC(c.state, uint8(nbBitsOut))
	c.state = c.stateTable[dstState]
}
1304301
func Zerof(t TestingT, i interface{}, msg string, args ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	return Zero(t, i, append([]interface{}{msg}, args...)...)
}
654701
func hasValue(fl FieldLevel) bool {

	field := fl.Field()

	switch field.Kind() {
	case reflect.Slice, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func:
		return !field.IsNil()
	default:

		if fl.(*validate).fldIsPointer && field.Interface() != nil {
			return true
		}

		return field.IsValid() && field.Interface() != reflect.Zero(field.Type()).Interface()
	}
}
1088130
func (L *State) IsGoStruct(index int) bool {
	return C.clua_isgostruct(L.s, C.int(index)) != 0
}
694519
func (term Range) IsZero() bool {
	return term.Start.IsZero() && term.End.IsZero()
}
692895
func isZeros(a Address) bool {
	for i := 0; i < len(a); i++ {
		if a[i] != 0 {
			return false
		}
	}
	return true
}
340036
func (c Color) IsZero() bool {
	return c.R == 0 && c.G == 0 && c.B == 0 && c.A == 0
}
1070945
func allZeros(b []byte) bool {
	for _, c := range b {
		if c != '0' {
			return false
		}
	}
	return true
}
828376
func isDoc(val reflect.Value) bool {
	iterations := 0
	for val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {
		val = val.Elem()
		// preventing cycles
		iterations++
		if iterations > 10 {
			return false
		}
	}
	return val.Kind() == reflect.Struct || val.Kind() == reflect.Map
}
697155
func (a *AttributeDefinition) AllNonZero() []string {
	nzs := make([]string, len(a.NonZeroAttributes))
	i := 0
	for n := range a.NonZeroAttributes {
		nzs[i] = n
		i++
	}
	return nzs
}
1054205
func (f *fieldVal) Zero() {
	f.n[0] = 0
	f.n[1] = 0
	f.n[2] = 0
	f.n[3] = 0
	f.n[4] = 0
	f.n[5] = 0
	f.n[6] = 0
	f.n[7] = 0
	f.n[8] = 0
	f.n[9] = 0
}
1257376
func Int64ValueOrZero(r *http.Request, k string) int64 {
	val, err := Int64ValueOrDefault(r, k, 0)
	if err != nil {
		return 0
	}
	return val
}
432417
func isEmpty(object interface{}) bool {

	// get nil case out of the way
	if object == nil {
		return true
	}

	objValue := reflect.ValueOf(object)

	switch objValue.Kind() {
	// collection types are empty when they have no element
	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
		return objValue.Len() == 0
	// pointers are empty if nil or if the value they point to is empty
	case reflect.Ptr:
		if objValue.IsNil() {
			return true
		}
		deref := objValue.Elem().Interface()
		return isEmpty(deref)
	// for all other types, compare against the zero value
	default:
		zero := reflect.Zero(objValue.Type())
		return reflect.DeepEqual(object, zero.Interface())
	}
}