// MarshalText preserves the Time as a byte array conforming to RFC3339 date-time (i.e.,
// 2006-01-02T15:04:05Z).
971967
func (t Time) MarshalText() (text []byte, err error) {
	return t.Time.MarshalText()
}
1146324
func (x *Big) MarshalText() ([]byte, error) {
	if debug {
		x.validate()
	}
	if x == nil {
		return []byte("<nil>"), nil
	}
	var (
		b = new(bytes.Buffer)
		f = formatter{w: b, prec: x.Precision(), width: noWidth}
		e = sciE[x.Context.OperatingMode]
	)
	b.Grow(x.Precision())
	f.format(x, normal, e)
	return b.Bytes(), nil
}
920079
func (h UnprefixedHash) MarshalText() ([]byte, error) {
	return []byte(hex.EncodeToString(h[:])), nil
}
1233238
func (t TimeRFC1123) MarshalText() ([]byte, error) {
	if y := t.Year(); y < 0 || y >= 10000 {
		return nil, errors.New("Time.MarshalText: year outside of range [0,9999]")
	}

	b := []byte(t.Format(rfc1123))
	return b, nil
}
1173850
func (id ID) MarshalText() ([]byte, error) {
	text := make([]byte, encodedLen)
	encode(text, id[:])
	return text, nil
}
69610
func (l *LocalDevices) MarshalText() ([]byte, error) {

	t := &bytes.Buffer{}
	fmt.Fprintf(t, "%s=", l.Driver)

	keys := []string{}

	for k := range l.DeviceMap {
		keys = append(keys, k)
	}

	sort.Sort(byString(keys))

	for _, k := range keys {
		fmt.Fprintf(t, "%s::%s,", k, l.DeviceMap[k])
	}

	if len(l.DeviceMap) > 0 {
		t.Truncate(t.Len() - 1)
	}

	return t.Bytes(), nil
}
1051700
func (m AppIDMetadata) MarshalText() ([]byte, error) {
	return []byte(fmt.Sprintf("AppID %s", m.AppID)), nil
}
640789
func (f Field) MarshalText() (p []byte, err error) {
	return []byte(f.reference.String()), nil
}
1039763
func (pos *Position) MarshalText() (text []byte, err error) {
	return []byte(pos.String()), nil
}
864285
func (f Framing) MarshalText() ([]byte, error) {
	s := f.String()
	if s != "" {
		return []byte(s), nil
	}
	return nil, fmt.Errorf("unknown framing")
}
527375
func (c Call) MarshalText() ([]byte, error) {
	if c.frame == (runtime.Frame{}) {
		return nil, ErrNoFunc
	}

	buf := bytes.Buffer{}
	fmt.Fprint(&buf, c)
	return buf.Bytes(), nil
}
421641
func (m PrefixMetadata) MarshalText() ([]byte, error) {
	return []byte(fmt.Sprintf("Prefix %s", m.Prefix)), nil
}
1174310
func (t ISO8601Time) MarshalText() ([]byte, error) {
	return []byte(time.Time(t).Format(time.RFC3339)), nil
}
809653
func (s String) MarshalJSON() ([]byte, error) {
	return json.Marshal([]interface{}{s.Timestamp, s.Value})
}
878650
func (u UUID) MarshalText() (text []byte, err error) {
	text = []byte(u.String())
	return
}
612349
func (m *Time) MarshalTo(data []byte) (int, error) {
	return m.ProtoTime().MarshalTo(data)
}
338427
func (u UUID) MarshalText() ([]byte, error) {
	/* Inlined UUID.String() implementation, cannot reuse the one from
	   UUID.String() as that cast will force an additional memory
	   allocation because current version the compiler (go 1.3.1) cannot
	   realize that the data pointer of the result of the UUID.String() call
	   can be moved to the byte-slice return. Speed difference from inlining
	   is about +20% */
	/* Equivalent code:
	   return []byte(u.String()), nil */
	/* NOTE: If this is changed, also look at the following methods:
	   UUID.MarshalJSON() and UUID.String() */
	b := [36]byte{}

	for i, n := range []int{
		0, 2, 4, 6,
		9, 11,
		14, 16,
		19, 21,
		24, 26, 28, 30, 32, 34,
	} {
		b[n] = halfbyte2hexchar[(u[i]>>4)&0x0f]
		b[n+1] = halfbyte2hexchar[u[i]&0x0f]
	}

	b[8] = '-'
	b[13] = '-'
	b[18] = '-'
	b[23] = '-'

	return b[:], nil
}