// IsEq is the validation function for validating if the current field's value is equal to the param's value.
427047
func isEq(fl FieldLevel) bool {

	field := fl.Field()
	param := fl.Param()

	switch field.Kind() {

	case reflect.String:
		return field.String() == param

	case reflect.Slice, reflect.Map, reflect.Array:
		p := asInt(param)

		return int64(field.Len()) == p

	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		p := asInt(param)

		return field.Int() == p

	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		p := asUint(param)

		return field.Uint() == p

	case reflect.Float32, reflect.Float64:
		p := asFloat(param)

		return field.Float() == p
	}

	panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
1014941
func (s expressionSequence) Validate() (errs []error) {
	for _, exp := range s {
		if err := exp.Validate(); err != nil {
			errs = append(errs, err)
		}
	}
	return
}
670750
func (u Vec) Eq(v Vec) bool {
	return nearlyEqual(u.X, v.X) && nearlyEqual(u.Y, v.Y)
}
919089
func (r *Record) SetSeq(s uint64) {
	r.signature = nil
	r.raw = nil
	r.seq = s
}
421827
func (id TLFID) Eq(other TLFID) bool {
	return bytes.Equal([]byte(id), []byte(other))
}
909481
func (s *CountService) Q(q string) *CountService {
	s.q = q
	return s
}
342388
func (s *NumberFilter) SetEq(v float64) *NumberFilter {
	s.Eq = &v
	return s
}
1083026
func (m *PTreeMap) Rseq() iseq.Seq {
	if m.count > 0 {
		return createTmnodeSeq(m.tree, false, m.count)
	}
	return nil
}
1163469
func EqF(field1, field2 string) Matcher {
	return NewField2FieldMatcher(field1, field2, token.EQL)
}
433197
func (d *database) ValidateQuery(ctx context.Context, query string) error {
	req, err := d.conn.NewRequest("POST", path.Join(d.relPath(), "_api/query"))
	if err != nil {
		return WithStack(err)
	}
	input := parseQueryRequest{
		Query: query,
	}
	if _, err := req.SetBody(input); err != nil {
		return WithStack(err)
	}
	resp, err := d.conn.Do(ctx, req)
	if err != nil {
		return WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return WithStack(err)
	}
	return nil
}
314063
func Eq(column string, value interface{}) Builder {
	return BuildFunc(func(d Dialect, buf Buffer) error {
		if value == nil {
			buf.WriteString(d.QuoteIdent(column))
			buf.WriteString(" IS NULL")
			return nil
		}
		v := reflect.ValueOf(value)
		if v.Kind() == reflect.Slice {
			if v.Len() == 0 {
				buf.WriteString(d.EncodeBool(false))
				return nil
			}
			return buildCmp(d, buf, "IN", column, value)
		}
		return buildCmp(d, buf, "=", column, value)
	})
}
905356
func (r *RangeOp) GtOrEq(fieldName string, value interface{}) *RangeOp {
	r.appendOp(GtOrEq, fieldName, value)
	return r
}
1264520
func NEQ(m interface{}, value interface{}) (Predicate, error) {
	p, err := EQ(m, value)
	if err != nil {
		return nil, err
	}
	return NOT(p), nil
}
1196382
func fieldEquals(field string, v interface{}) scope {
	return scopeFunc(func(db *gorm.DB) *gorm.DB {
		return db.Where(fmt.Sprintf("%s = ?", field), v)
	})
}
824157
func (p *PublicKey) IsEqual(otherPubKey *PublicKey) bool {
	return p.X.Cmp(otherPubKey.X) == 0 &&
		p.Y.Cmp(otherPubKey.Y) == 0
}
764228
func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	return JSONEq(t, expected, actual, append([]interface{}{msg}, args...)...)
}
1167503
func AssertEq(expected, actual interface{}, errorParts ...interface{}) {
	assertThat(
		actual,
		oglematchers.Equals(expected),
		1,
		errorParts)
}