func (n *node) merge(p *payload) {
	fmt.Printf("sync \t\t\tnode %d:\t%v\n", n.id, n.gcounter)
	fmt.Printf("with payload from \tnode %d: %d\n", p.fromNodeId, p.gcounter)

	for i, _ := range p.gcounter {
		if p.gcounter[i] > n.gcounter[i] {
			n.gcounter[i] = p.gcounter[i]
		}
	}

	fmt.Printf("sync result\t\tnode %d: %v\n\n", n.id, n.gcounter)
}
// merge compares the payload with the node's record of state
// and determines the update.
merge compares the payload with the node's record of state
and determines the update.
// merge compares the payload with the node ' s record of state // and determines the update .
func (n *node) merge(p *payload) {
	fmt.Printf("sync \t\t\tnode %d:\t%v\n", n.id, n.gcounter)
	fmt.Printf("with payload from \tnode %d: %d\n", p.fromNodeId, p.gcounter)
	for i, _ := range p.gcounter {
		if p.gcounter[i] > n.gcounter[i] {
			n.gcounter[i] = p.gcounter[i]
		}
	}
	fmt.Printf("sync result\t\tnode %d: %v\n\n", n.id, n.gcounter)
}
func ( n * node ) merge ( p * payload ) { fmt . Printf ( " \t \t \t \t \n " , n . id , n . gcounter ) fmt . Printf ( " \t \n " , p . fromNodeId , p . gcounter ) for i , _ := range p . gcounter { if p . gcounter [ i ] > n . gcounter [ i ] { n . gcounter [ i ] = p . gcounter [ i ] } } fmt . Printf ( " \t \t \n \n " , n . id , n . gcounter ) }
merge compares the payload with the node's record of state
and determines the update.
merge compares the payload with the node ' s record of state and determines the update .