code: func (s *BufferedSender) flush(b *bytes.Buffer) (int, error) {
  	bb := b.Bytes()
  	bbl := len(bb)
  	if bb[bbl-1] == '\n' {
  		bb = bb[:bbl-1]
  	}
  	//n, err := s.sender.Send(bytes.TrimSuffix(b.Bytes(), []byte("\n")))
  	n, err := s.sender.Send(bb)
  	b.Truncate(0) // clear the buffer
  	return n, err
  }
docs: // send to remove endpoint and truncate buffer