// Add appens a trace message to the ring buffer, consolidating trace
// messages based on the optional consolidation function.
499575
func (trb *RingBuffer) Add(title string, body []byte) {
	if len(trb.msgs) <= 0 {
		return
	}

	msg := &Msg{
		Title:   title,
		Body:    body,
		Repeats: 1,
	}

	trb.m.Lock()

	if trb.consolidateFunc != nil {
		msg = trb.consolidateFunc(msg, trb.lastUNLOCKED())
		if msg == nil {
			trb.m.Unlock()

			return
		}
	}

	trb.msgs[trb.next] = *msg

	trb.next++
	if trb.next >= len(trb.msgs) {
		trb.next = 0
	}

	trb.m.Unlock()
}
534183
func (b *Buffer) Add(w io.Writer) error {
	if w == nil {
		return errors.New("参数w不能为一个空值")
	}

	b.ws = append(b.ws, w)
	return nil
}
256307
func (b *Broadcaster) Add(sink Sink) error {
	return b.configure(b.adds, sink)
}
1272423
func (s *messageStoreImpl) Add(message interface{}) bool {
	s.lock.Lock()
	defer s.lock.Unlock()

	n := len(s.messages)
	for i := 0; i < n; i++ {
		m := s.messages[i]
		switch s.pol(message, m.data) {
		case common.MessageInvalidated:
			return false
		case common.MessageInvalidates:
			s.invTrigger(m.data)
			s.messages = append(s.messages[:i], s.messages[i+1:]...)
			n--
			i--
		}
	}

	s.messages = append(s.messages, &msg{data: message, created: time.Now()})
	return true
}
52504
func (e *ErrorGroup) Add(err error) {
	if err != nil {
		e.Errors = append(e.Errors, err)
	}
}
721770
func (mr *MockBlobstoreMockRecorder) Add(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockBlobstore)(nil).Add), arg0)
}
1143544
func (h *History) Add(input string) {
	h.histories = append(h.histories, input)
	h.Clear()
}
828076
func (mr *MockRenderedJobListMockRecorder) Add(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockRenderedJobList)(nil).Add), arg0)
}
884014
func (writer *sparseWriter) Append(k, idx uint32, rho uint8) {
	if writer.hasCurrVal {
		if idx == writer.currIdx {
			if rho > writer.currRho {
				writer.currRho = rho
				writer.currVal = k
			}
			return
		} else {
			writer.commit()
		}
	}

	writer.hasCurrVal = true
	writer.currVal = k
	writer.currIdx = idx
	writer.currRho = rho
}
751013
func (s *Stack) Add(m ...Middleware) {
	for _, mdw := range m {
		s.Stack = s.Stack.Append(alice.Constructor(mdw))
	}
}
326845
func (m *RegexpMap) Add(reStr string, lookupValue string) error {
	_, exists := m.rules[reStr]
	if !exists {
		rule, err := regexp.Compile(reStr)
		if err != nil {
			return err
		}
		m.rules[reStr] = rule
	}
	val, exists := m.lookupValues[lookupValue]
	if !exists {
		val = NewRegexpList()
		m.lookupValues[lookupValue] = val
	}
	val.Add(reStr)

	lookupCount, exists := m.rulesRelation[reStr]
	if !exists {
		lookupCount = refCount{}
		m.rulesRelation[reStr] = lookupCount
	}
	lookupCount.Increment(lookupValue)
	return nil
}
1072104
func (v *ValidationError) Add(err error) {
	if err != nil {
		v.Errors = append(v.Errors, err)
	}
}
613630
func (e *Errors) Add(fieldNames []string, classification, message string) {
	*e = append(*e, Error{
		FieldNames:     fieldNames,
		Classification: classification,
		Message:        message,
	})
}
596277
func (msg *Message) Append(args ...interface{}) {
	msg.Arguments = append(msg.Arguments, args...)
}
830113
func (errs Errors) Add(newErrors ...error) Errors {
	for _, err := range newErrors {
		if err == nil {
			continue
		}

		if errors, ok := err.(Errors); ok {
			errs = errs.Add(errors...)
		} else {
			ok = true
			for _, e := range errs {
				if err == e {
					ok = false
				}
			}
			if ok {
				errs = append(errs, err)
			}
		}
	}
	return errs
}
1043999
func (m BatchMock) Add(statement string, arguments ...interface{}) {
	m.Called(statement, arguments)
}
786124
func (w *Unbuffered) Add(writer io.WriteCloser) {
	w.mu.Lock()
	w.writers = append(w.writers, writer)
	w.mu.Unlock()
}