// Message returns the reason the parameter was invalid, and its context.
191765
func (e *errInvalidParam) Message() string {
	return fmt.Sprintf("%s, %s.", e.msg, e.Field())
}
1043928
func (e ParameterRequiredError) Error() string {
	return fmt.Sprintf(`"%s" is required in "%s"`, e.ParameterName, e.ParentName)
}
912799
func Message(locale, message string, args ...interface{}) string {
	language, region := parseLocale(locale)
	unknownValueFormat := getUnknownValueFormat()

	messageConfig, knownLanguage := messages[language]
	if !knownLanguage {
		i18nLog.Debugf("Unsupported language for locale '%s' and message '%s', trying default language", locale, message)

		if defaultLanguage, found := Config.String(defaultLanguageOption); found {
			i18nLog.Debugf("Using default language '%s'", defaultLanguage)

			messageConfig, knownLanguage = messages[defaultLanguage]
			if !knownLanguage {
				i18nLog.Debugf("Unsupported default language for locale '%s' and message '%s'", defaultLanguage, message)
				return fmt.Sprintf(unknownValueFormat, message)
			}
		} else {
			i18nLog.Warnf("Unable to find default language option (%s); messages for unsupported locales will never be translated", defaultLanguageOption)
			return fmt.Sprintf(unknownValueFormat, message)
		}
	}

	// This works because unlike the goconfig documentation suggests it will actually
	// try to resolve message in DEFAULT if it did not find it in the given section.
	value, err := messageConfig.String(region, message)
	if err != nil {
		i18nLog.Warnf("Unknown message '%s' for locale '%s'", message, locale)
		return fmt.Sprintf(unknownValueFormat, message)
	}

	if len(args) > 0 {
		i18nLog.Debugf("Arguments detected, formatting '%s' with %v", value, args)
		safeArgs := make([]interface{}, 0, len(args))
		for _, arg := range args {
			switch a := arg.(type) {
			case template.HTML:
				safeArgs = append(safeArgs, a)
			case string:
				safeArgs = append(safeArgs, template.HTML(template.HTMLEscapeString(a)))
			default:
				safeArgs = append(safeArgs, a)
			}
		}
		value = fmt.Sprintf(value, safeArgs...)
	}

	return value
}
21357
func (r *Room) Message(ctx context.Context, msg *UserMessage) {
	logger := pitaya.GetDefaultLoggerFromCtx(ctx)
	err := pitaya.GroupBroadcast(ctx, "connector", "room", "onMessage", msg)
	if err != nil {
		logger.Error("Error broadcasting message")
		logger.Error(err)
	}
}
1268173
func MessageFromBytes(msgBytes []byte) (msg RFC2822Message, err error) {
	// The header and body are separated by a double new-line
	splitMessage := bytes.SplitN(msgBytes, []byte("\r\n\r\n"), 2)

	// Read the headers
	headerReader := textproto.NewReader(bufio.NewReader(bytes.NewReader(splitMessage[0])))
	msg.Headers, err = headerReader.ReadMIMEHeader()

	if err != nil && err != io.EOF {
		return msg, err
	}

	if len(splitMessage) == 2 {
		msg.Body = string(splitMessage[1])
	}

	return msg, nil
}
134314
func Message(buffer Buffer, event *cue.Event) {
	buffer.AppendString(event.Message)
}
700764
func (v *requiredRule) Error(message string) *requiredRule {
	return &requiredRule{
		message: message,
		skipNil: v.skipNil,
	}
}
1230352
func (err BadParameterError) Error() string {
	if err.hasExpectedValue {
		return fmt.Sprintf(stBadParameterErrorExpectedMsg, err.parameter, err.value, err.expectedValue, err.errorMessage)
	}
	return fmt.Sprintf(stBadParameterErrorMsg, err.parameter, err.value, err.errorMessage)
}
1367893
func (r *multipleOfRule) Error(message string) *multipleOfRule {
	r.message = message
	return r
}
819113
func (s *Status) Message() string {
	if s == nil || s.s == nil {
		return ""
	}
	return s.s.Message
}
1327798
func (e *ErrorResponse) Error() string {
	msg := fmt.Sprintf("[%s] %d %s: %s", e.ID, e.Status, e.Code, e.Detail)
	for k, v := range e.Meta {
		msg += ", " + fmt.Sprintf("%s: %v", k, v)
	}
	return msg
}
707879
func (r *NotInRule) Error(message string) *NotInRule {
	r.message = message
	return r
}
126739
func message(canvas *svg.SVG, x, y, w, h, l int, bcolor, scolor string) {
	et := h / 3
	w2 := w / 2
	px := w / 8
	py := h / 8
	e1x := []int{x, x, x + w, x + w, x + w2, x}
	e1y := []int{y + et, y + h, y + h, y + et, y + (et * 2), y + et}
	e2x := []int{x, x + w2, x + w, x + w2, x}
	e2y := []int{y + et, y, y + et, y + (et * 2), y + et}

	canvas.Polygon(e2x, e2y, "fill:"+bcolor)
	canvas.Polygon(e1x, e1y, "fill:"+scolor)
	canvas.Roundrect(x+px, y+py, w-(px*2), h-py, l, l, "fill:"+scolor)
	canvas.Line(x, y+et, x+w2, y+(et*2), "stroke-width:1;stroke:"+bcolor)
	canvas.Line(x+w, y+et, x+w2, y+(et*2), "stroke-width:1;stroke:"+bcolor)
}
709631
func (rm *RegistryMessage) ValidateMessage() bool {
	return rm.RouteServiceURL == "" || strings.HasPrefix(rm.RouteServiceURL, "https")
}
1300402
func Message(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "message", Listener: listener}
}
1199695
func (r *InRule) Error(message string) *InRule {
	r.message = message
	return r
}
228099
func (m *Message) String() string {
	return fmt.Sprintf("<Message Topic=%q QOS=%d Retain=%t Payload=%v>",
		m.Topic, m.QOS, m.Retain, m.Payload)
}