code: func moveDeadNodes(nodes []*nodeState, gossipToTheDeadTime time.Duration) int {
  	numDead := 0
  	n := len(nodes)
  	for i := 0; i < n-numDead; i++ {
  		if nodes[i].State != stateDead {
  			continue
  		}
  
  		// Respect the gossip to the dead interval
  		if time.Since(nodes[i].StateChange) <= gossipToTheDeadTime {
  			continue
  		}
  
  		// Move this node to the end
  		nodes[i], nodes[n-numDead-1] = nodes[n-numDead-1], nodes[i]
  		numDead++
  		i--
  	}
  	return n - numDead
  }
docs: // moveDeadNodes moves nodes that are dead and beyond the gossip to the dead interval
  // to the end of the slice and returns the index of the first moved node.