// FindAny will return the first message
// where all filters return true. If no
// messages match we will return ErrNotFound.
FindAny will return the first message
where all filters return true. If no
messages match we will return ErrNotFound.
// FindAny will return the first message // where all filters return true . If no // messages match we will return ErrNotFound .
func (messages Messages) FindAny(filters ...Filter) (proto.Message, error) {
	var match bool
loop:
	for _, message := range messages {
		for _, filter := range filters {
			match = filter(message)
			if !match {
				continue loop
			}
		}
		if match {
			return message, nil
		}
	}
	return nil, ErrNotFound
}
func ( messages Messages ) FindAny ( filters ... Filter ) ( proto . Message , error ) { var match bool loop : for _ , message := range messages { for _ , filter := range filters { match = filter ( message ) if ! match { continue loop } } if match { return message , nil } } return nil , ErrNotFound }
FindAny will return the first message
where all filters return true.
FindAny will return the first message where all filters return true .