func (m Message) format(source, multi bool) string {
	var ss []string
	var prefix, nextPrefix string
	for _, v := range m {
		// Ensure certain tokens have preceding or succeeding newlines.
		prefix, nextPrefix = nextPrefix, " "
		if multi {
			switch v := v.(type) {
			case Tag: // only has preceding newline
				prefix = "\n"
			case Denormalized: // only has preceding newline
				if _, ok := v.Value.(Tag); ok {
					prefix = "\n"
				}
			case Message, Raw: // has preceding and succeeding newlines
				prefix, nextPrefix = "\n", "\n"
			}
		}

		s := formatToken(v, source, multi)
		ss = append(ss, prefix+s+",")
	}

	var s string
	if len(ss) > 0 {
		s = strings.TrimSpace(strings.Join(ss, ""))
		if multi {
			s = "\n\t" + strings.Join(strings.Split(s, "\n"), "\n\t") + "\n"
		} else {
			s = strings.TrimSuffix(s, ",")
		}
	}
	s = fmt.Sprintf("%T{%s}", m, s)
	if !source {
		s = trimPackage(s)
	}
	return s
}
// format formats the message.
// If source is enabled, this emits valid Go source.
// If multi is enabled, the output may span multiple lines.
format formats the message.
If source is enabled, this emits valid Go source.
If multi is enabled, the output may span multiple lines.
// format formats the message . // If source is enabled this emits valid Go source . // If multi is enabled the output may span multiple lines .
func (m Message) format(source, multi bool) string {
	var ss []string
	var prefix, nextPrefix string
	for _, v := range m {
		prefix, nextPrefix = nextPrefix, " "
		if multi {
			switch v := v.(type) {
			case Tag: 
				prefix = "\n"
			case Denormalized: 
				if _, ok := v.Value.(Tag); ok {
					prefix = "\n"
				}
			case Message, Raw: 
				prefix, nextPrefix = "\n", "\n"
			}
		}
		s := formatToken(v, source, multi)
		ss = append(ss, prefix+s+",")
	}
	var s string
	if len(ss) > 0 {
		s = strings.TrimSpace(strings.Join(ss, ""))
		if multi {
			s = "\n\t" + strings.Join(strings.Split(s, "\n"), "\n\t") + "\n"
		} else {
			s = strings.TrimSuffix(s, ",")
		}
	}
	s = fmt.Sprintf("%T{%s}", m, s)
	if !source {
		s = trimPackage(s)
	}
	return s
}
func ( m Message ) format ( source , multi bool ) string { var ss [ ] string var prefix , nextPrefix string for _ , v := range m { prefix , nextPrefix = nextPrefix , " " if multi { switch v := v . ( type ) { case Tag : prefix = " \n " case Denormalized : if _ , ok := v . Value . ( Tag ) ; ok { prefix = " \n " } case Message , Raw : prefix , nextPrefix = " \n " , " \n " } } s := formatToken ( v , source , multi ) ss = append ( ss , prefix + s + " " ) } var s string if len ( ss ) > 0 { s = strings . TrimSpace ( strings . Join ( ss , " " ) ) if multi { s = " \n \t " + strings . Join ( strings . Split ( s , " \n " ) , " \n \t " ) + " \n " } else { s = strings . TrimSuffix ( s , " " ) } } s = fmt . Sprintf ( " " , m , s ) if ! source { s = trimPackage ( s ) } return s }
format formats the message.
format formats the message .
// Ensure certain tokens have preceding or succeeding newlines. // only has preceding newline // only has preceding newline // has preceding and succeeding newlines