code: func makeSortedPendingMsgs(pendingMsgs map[uint64]int64) []*pendingMsg {
  	results := make([]*pendingMsg, 0, len(pendingMsgs))
  	for seq, expire := range pendingMsgs {
  		results = append(results, &pendingMsg{seq: seq, expire: expire})
  	}
  	sort.Sort(byExpire(results))
  	return results
  }
docs: // Returns an array of pendingMsg ordered by expiration date, unless
  // the expiration date in the pendingMsgs map is not set (0), which
  // happens after a server restart. In this case, the array is ordered
  // by message sequence numbers.