// ReadMessage reads a full message from the input.
//
// This function calls MessageReader.ReadLine() until a Message is returned
// and then returns that.
ReadMessage reads a full message from the input.

This function calls MessageReader.ReadLine() until a Message is returned
and then returns that.
// ReadMessage reads a full message from the input . // // This function calls MessageReader . ReadLine () until a Message is returned // and then returns that .
func (r *MessageReader) ReadMessage() (*Message, error) {
	var errs []error
	var err error
	var msg *Message
	for msg == nil {
		msg, err = r.ReadLine()
		if err != nil {
			if msg != nil || err == io.EOF {
				if len(errs) > 0 {
					errs = append(errs, err)
					return msg, errorGroup("Errors while reading message:", errs)
				}
				return msg, err
			}
			errs = append(errs, err)
		}
	}
	if len(errs) > 0 {
		return msg, errorGroup("Errors while reading message:", errs)
	}
	return msg, nil
}
func ( r * MessageReader ) ReadMessage ( ) ( * Message , error ) { var errs [ ] error var err error var msg * Message for msg == nil { msg , err = r . ReadLine ( ) if err != nil { if msg != nil || err == io . EOF { if len ( errs ) > 0 { errs = append ( errs , err ) return msg , errorGroup ( " " , errs ) } return msg , err } errs = append ( errs , err ) } } if len ( errs ) > 0 { return msg , errorGroup ( " " , errs ) } return msg , nil }
ReadMessage reads a full message from the input.
ReadMessage reads a full message from the input .