code: func (s *sender) resendSegment() {
  	// Don't use any segments we already sent to measure RTT as they may
  	// have been affected by packets being lost.
  	s.rttMeasureSeqNum = s.sndNxt
  
  	// Resend the segment.
  	if seg := s.writeList.Front(); seg != nil {
  		if seg.data.Size() > s.maxPayloadSize {
  			available := s.maxPayloadSize
  			// Split this segment up.
  			nSeg := seg.clone()
  			nSeg.data.TrimFront(available)
  			nSeg.sequenceNumber.UpdateForward(seqnum.Size(available))
  			s.writeList.InsertAfter(seg, nSeg)
  			seg.data.CapLength(available)
  		}
  		s.sendSegment(seg.data, seg.flags, seg.sequenceNumber)
  		s.ep.stack.Stats().TCP.FastRetransmit.Increment()
  		s.ep.stack.Stats().TCP.Retransmits.Increment()
  	}
  }
docs: // resendSegment resends the first unacknowledged segment.