// extractMessages extracts messages from the bytes of a Go source file.
420707
func extractMessages(buf []byte) ([]*i18n.Message, error) {
	fset := token.NewFileSet()
	file, err := parser.ParseFile(fset, "", buf, parser.AllErrors)
	if err != nil {
		return nil, err
	}
	extractor := newExtractor(file)
	ast.Walk(extractor, file)
	return extractor.messages, nil
}
769731
func (c *Client) SendMessages(m []models.Message, handler func(ack string) error) error {
	_, err := c.conn.SendRequest("msg.send", m, func(ctx *neptulon.ResCtx) error {
		var ack string
		if err := ctx.Result(&ack); err != nil {
			return fmt.Errorf("client: msg.send: error reading response: %v", err)
		}
		return handler(ack)
	})

	if err != nil {
		return fmt.Errorf("client: msg.send: error sending request: %v", err)
	}

	return nil
}
932979
func (s *SocketWorker) Messages() <-chan *WebsocketMessage {
	if s.writing {
		return s.mesgs
	}

	flux.GoDefer("Socket:Message:Receiver", func() {
		for dag := range s.data {
			if mg, ok := dag.(*WebsocketMessage); ok {
				s.mesgs <- mg
			}
		}
	})

	return s.mesgs
}
1192590
func (s *TestRoleOutput) SetMessages(v []*string) *TestRoleOutput {
	s.Messages = v
	return s
}
646203
func UnmarshalMessageSet(buf []byte, m map[int32]Extension) error {
	ms := new(MessageSet)
	if err := Unmarshal(buf, ms); err != nil {
		return err
	}
	for _, item := range ms.Item {
		// restore wire type and field number varint, plus length varint.
		b := EncodeVarint(uint64(*item.TypeId)<<3 | WireBytes)
		b = append(b, EncodeVarint(uint64(len(item.Message)))...)
		b = append(b, item.Message...)

		m[*item.TypeId] = Extension{enc: b}
	}
	return nil
}
937862
func (b *Broker) collectMessages(in <-chan Message) {
	for {
		msg := <-in
		b.queue.Push(&msg)
	}
}
1140339
func (v *Bonk) GetMessage() (o string) {
	if v != nil && v.Message != nil {
		return *v.Message
	}

	return
}
605231
func (t *Topic) PutMessages(msgs []*Message) error {
	t.RLock()
	defer t.RUnlock()
	if atomic.LoadInt32(&t.exitFlag) == 1 {
		return errors.New("exiting")
	}

	messageTotalBytes := 0

	for i, m := range msgs {
		err := t.put(m)
		if err != nil {
			atomic.AddUint64(&t.messageCount, uint64(i))
			atomic.AddUint64(&t.messageBytes, uint64(messageTotalBytes))
			return err
		}
		messageTotalBytes += len(m.Body)
	}

	atomic.AddUint64(&t.messageBytes, uint64(messageTotalBytes))
	atomic.AddUint64(&t.messageCount, uint64(len(msgs)))
	return nil
}
1115540
func (f *PeerEventsFilter) ReceivedMessages() *PeerEventsFilter {
	f.eventType = simulations.EventTypeMsg
	b := true
	f.msgReceive = &b
	return f
}
377411
func Extract(str string) ([][]byte, error) {
	m := re.FindAllString(str, -1)
	result := make([][]byte, 0, len(m))
	for _, s := range m {
		b, err := FromString(s)
		if err != nil {
			return nil, err
		}
		result = append(result, b)
	}
	return result, nil
}
383251
func (wc *WhisperClient) GetFilterMessages(ctx *Context, id string) (*Messages, error) {
	rawFilterMessages, err := wc.client.FilterMessages(ctx.context, id)
	if err != nil {
		return nil, err
	}
	res := make([]*whisper.Message, len(rawFilterMessages))
	copy(res, rawFilterMessages)
	return &Messages{res}, nil
}
131384
func Bytes(m []ValidMessage) [][]byte {
	ret := make([][]byte, len(m))
	//copy because we don't want to hold references to m's fragments
	for i, f := range m {
		ret[i] = make([]byte, len(f))
		copy(ret[i], []byte(f))
	}
	return ret
}
1353238
func (r *Renderer) WithMessages(bundle soymsg.Bundle) *Renderer {
	r.msgs = bundle
	return r
}
439598
func extractFullErrorMessage(e DropboxError, includeStack bool) string {
	var ok bool
	var lastDbxErr DropboxError
	errMsg := bytes.NewBuffer(make([]byte, 0, 1024))

	dbxErr := e
	for {
		lastDbxErr = dbxErr
		errMsg.WriteString(dbxErr.GetMessage())

		innerErr := dbxErr.GetInner()
		if innerErr == nil {
			break
		}
		dbxErr, ok = innerErr.(DropboxError)
		if !ok {
			// We have reached the end and traveresed all inner errors.
			// Add last message and exit loop.
			errMsg.WriteString(innerErr.Error())
			break
		}
		errMsg.WriteString("\n")
	}
	if includeStack {
		errMsg.WriteString("\nORIGINAL STACK TRACE:\n")
		errMsg.WriteString(lastDbxErr.GetStack())
	}
	return errMsg.String()
}
951045
func (v *ResourceDoesNotExist) GetMessage() (o string) {
	if v != nil && v.Message != nil {
		return *v.Message
	}

	return
}
750895
func (t *Tag) GetMessage() string {
	if t == nil || t.Message == nil {
		return ""
	}
	return *t.Message
}
917776
func (v *Xception) GetMessage() (o string) {
	if v != nil && v.Message != nil {
		return *v.Message
	}

	return
}