MCPcopy Create free account
hub / github.com/coder/coder / nodesEqual

Function nodesEqual

enterprise/tailnet/pgcoord.go:677–686  ·  view source on GitHub ↗

nodesEqual compares two proto.Node messages, ignoring the AsOf timestamp which changes on every node build even when nothing else has changed.

(a, b *proto.Node)

Source from the content-addressed store, hash-verified

675// timestamp which changes on every node build even when nothing else
676// has changed.
677func nodesEqual(a, b *proto.Node) bool {
678 if a == nil || b == nil {
679 return a == b
680 }
681 //nolint:forcetypeassert
682 aClone, bClone := gProto.Clone(a).(*proto.Node), gProto.Clone(b).(*proto.Node)
683 aClone.AsOf = nil
684 bClone.AsOf = nil
685 return gProto.Equal(aClone, bClone)
686}
687
688// retrieveBinding gets the latest binding for a key.
689func (b *binder) retrieveBinding(bk bKey) binding {

Callers 2

Test_nodesEqualFunction · 0.85
storeBindingMethod · 0.85

Calls 2

CloneMethod · 0.45
EqualMethod · 0.45

Tested by 1

Test_nodesEqualFunction · 0.68