// MarshalTextString is the same as MarshalText, but returns the string directly.
12827
func MarshalTextString(pb Message) string {
	var buf bytes.Buffer
	marshalText(&buf, pb, false)
	return buf.String()
}
233839
func (c Code) MarshalText() ([]byte, error) {
	s, ok := _codeToString[c]
	if ok {
		return []byte(s), nil
	}
	return nil, fmt.Errorf("unknown code: %d", int(c))
}
852619
func (a UnprefixedAddress) MarshalText() ([]byte, error) {
	return []byte(hex.EncodeToString(a[:])), nil
}
1143569
func (n NullString) MarshalJSON() ([]byte, error) {
	if n.Valid {
		return json.Marshal(n.String)
	}
	return nullString, nil
}
711859
func (t Token) MarshalText() ([]byte, error) {
	number := uint64(t)
	var chars []byte

	if number == 0 {
		return chars, nil
	}

	for number > 0 {
		result := number / base62Len
		remainder := number % base62Len
		chars = append(chars, Base62[remainder])
		number = result
	}

	for i, j := 0, len(chars)-1; i < j; i, j = i+1, j-1 {
		chars[i], chars[j] = chars[j], chars[i]
	}

	return chars, nil
}
1348857
func (t TextErr) MarshalText() ([]byte, error) {
	return []byte(t.Err.Error()), nil
}
1226842
func (d Date) MarshalText() (text []byte, err error) {
	return []byte(fmt.Sprintf(dateFormat, d.Year(), d.Month(), d.Day())), nil
}
1003186
func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
	return marshalIndent(v, prefix, indent)
}
1185554
func (id ID) MarshalText() ([]byte, error) {
	bytes, err := id.MarshalBinary()
	if err != nil {
		return nil, err
	}
	return []byte(hex.EncodeToString(bytes)), nil
}
1039763
func (pos *Position) MarshalText() (text []byte, err error) {
	return []byte(pos.String()), nil
}
859030
func (c *TextComponent) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type    FlexComponentType        `json:"type"`
		Text    string                   `json:"text"`
		Flex    *int                     `json:"flex,omitempty"`
		Margin  FlexComponentMarginType  `json:"margin,omitempty"`
		Size    FlexTextSizeType         `json:"size,omitempty"`
		Align   FlexComponentAlignType   `json:"align,omitempty"`
		Gravity FlexComponentGravityType `json:"gravity,omitempty"`
		Wrap    bool                     `json:"wrap,omitempty"`
		Weight  FlexTextWeightType       `json:"weight,omitempty"`
		Color   string                   `json:"color,omitempty"`
		Action  TemplateAction           `json:"action,omitempty"`
	}{
		Type:    FlexComponentTypeText,
		Text:    c.Text,
		Flex:    c.Flex,
		Margin:  c.Margin,
		Size:    c.Size,
		Align:   c.Align,
		Gravity: c.Gravity,
		Wrap:    c.Wrap,
		Weight:  c.Weight,
		Color:   c.Color,
		Action:  c.Action,
	})
}
362038
func (f Float) MarshalText() ([]byte, error) {
	if !f.Valid {
		return []byte{}, nil
	}
	return []byte(strconv.FormatFloat(f.Float64, 'f', -1, 64)), nil
}
939851
func (j JSONText) MarshalJSON() ([]byte, error) {
	if len(j) == 0 {
		return emptyJSON, nil
	}
	return j, nil
}
861505
func (u Array) MarshalText() ([]byte, error) {
	var js [36]byte
	encodeHex(js[:], u[:])
	return js[:], nil
}
1259330
func (j JSONText) MarshalJSON() ([]byte, error) {
	if j == nil {
		return []byte(`null`), nil
	}
	return j, nil
}
1343879
func (re Unknown) MarshalJSON() ([]byte, error) {
	if re.RawJSON == nil {
		return []byte("null"), nil
	}
	return re.RawJSON, nil
}
137633
func (t ts) MarshalJSON() ([]byte, error) {
	stringTime := t.Format(time.ANSIC)
	return json.Marshal(stringTime)
}