code: func (s *Simulator) popEvent() event {
  	if len(s.events) == 0 {
  		panic("no events to pop")
  	}
  	return heap.Pop(&s.events).(event)
  }
docs: // popEvent removes the event that happens next.
  //
  // Panics if there's no pending events.