MCPcopy
hub / github.com/flosch/pongo2 / EqualValueTo

Method EqualValueTo

value.go:485–494  ·  view source on GitHub ↗

EqualValueTo checks whether two values are containing the same value or object.

(other *Value)

Source from the content-addressed store, hash-verified

483
484// EqualValueTo checks whether two values are containing the same value or object.
485func (v *Value) EqualValueTo(other *Value) bool {
486 // comparison of uint with int fails using .Interface()-comparison (see issue #64)
487 if v.IsInteger() && other.IsInteger() {
488 return v.Integer() == other.Integer()
489 }
490 if v.IsTime() && other.IsTime() {
491 return v.Time().Equal(other.Time())
492 }
493 return v.Interface() == other.Interface()
494}
495
496type sortedKeys []reflect.Value
497

Callers 5

ContainsMethod · 0.80
ExecuteMethod · 0.80
EvaluateMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80

Calls 5

IsIntegerMethod · 0.95
IntegerMethod · 0.95
IsTimeMethod · 0.95
TimeMethod · 0.95
InterfaceMethod · 0.95

Tested by

no test coverage detected