code: func (l *logStream) publishBatch(batch *eventBatch) {
  	if batch.isEmpty() {
  		return
  	}
  	cwEvents := unwrapEvents(batch.events())
  
  	nextSequenceToken, err := l.putLogEvents(cwEvents, l.sequenceToken)
  
  	if err != nil {
  		if awsErr, ok := err.(awserr.Error); ok {
  			if awsErr.Code() == dataAlreadyAcceptedCode {
  				// already submitted, just grab the correct sequence token
  				parts := strings.Split(awsErr.Message(), " ")
  				nextSequenceToken = &parts[len(parts)-1]
  				logrus.WithFields(logrus.Fields{
  					"errorCode":     awsErr.Code(),
  					"message":       awsErr.Message(),
  					"logGroupName":  l.logGroupName,
  					"logStreamName": l.logStreamName,
  				}).Info("Data already accepted, ignoring error")
  				err = nil
  			} else if awsErr.Code() == invalidSequenceTokenCode {
  				// sequence code is bad, grab the correct one and retry
  				parts := strings.Split(awsErr.Message(), " ")
  				token := parts[len(parts)-1]
  				nextSequenceToken, err = l.putLogEvents(cwEvents, &token)
  			}
  		}
  	}
  	if err != nil {
  		logrus.Error(err)
  	} else {
  		l.sequenceToken = nextSequenceToken
  	}
  }
docs: // publishBatch calls PutLogEvents for a given set of InputLogEvents,
  // accounting for sequencing requirements (each request must reference the
  // sequence token returned by the previous request).