// MarshalText implements the encoding.TextMarshaler interface and
// encodes the game's PGN.
11699
func (g *Game) MarshalText() (text []byte, err error) {
	return []byte(encodePGN(g)), 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
}
262253
func (b Compatibool) MarshalText() ([]byte, error) {
	if b {
		return []byte("1"), nil
	}
	return []byte("0"), nil
}
723728
func (b *Board) MarshalText() (text []byte, err error) {
	return []byte(b.String()), nil
}
852619
func (a UnprefixedAddress) MarshalText() ([]byte, error) {
	return []byte(hex.EncodeToString(a[:])), nil
}
222734
func (m RawMessage) MarshalJSON() ([]byte, error) {
	if m == nil {
		return []byte("null"), nil
	}
	return m, nil
}
650645
func (t JSONTime) MarshalText() ([]byte, error) {
	if time.Time(t).IsZero() || time.Time(t).Unix() == 0 {
		return []byte{}, nil
	}
	stamp := time.Time(t).UTC().Format(time.RFC3339Nano)
	return []byte(stamp), nil
}
640789
func (f Field) MarshalText() (p []byte, err error) {
	return []byte(f.reference.String()), nil
}
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))
}
66655
func (i *HexOrDecimal256) MarshalText() ([]byte, error) {
	if i == nil {
		return []byte("0x0"), nil
	}
	return []byte(fmt.Sprintf("%#x", (*big.Int)(i))), nil
}
76162
func (tf timeFormat) MarshalText() (text []byte, err error) {
	// The following code adapted from the standard library time.Time.Format
	// method. Using the same undocumented magic constant to extend the size
	// of the buffer as seen there.
	b := make([]byte, 0, len(tf.layout)+10)
	b = tf.time.AppendFormat(b, tf.layout)
	return b, nil
}
1224985
func (v Span) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson72863a49EncodeGithubComSignalfxGolibTraceFormat1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
1051700
func (m AppIDMetadata) MarshalText() ([]byte, error) {
	return []byte(fmt.Sprintf("AppID %s", m.AppID)), nil
}
1227031
func (af *aggFunction) MarshalJSON() ([]byte, error) {
	buffer := bytes.NewBufferString(fmt.Sprintf("\"%s\"", af))
	return buffer.Bytes(), nil
}
12827
func MarshalTextString(pb Message) string {
	var buf bytes.Buffer
	marshalText(&buf, pb, false)
	return buf.String()
}
920079
func (h UnprefixedHash) MarshalText() ([]byte, error) {
	return []byte(hex.EncodeToString(h[:])), nil
}
1093131
func (t Timestamp) MarshalText() (text []byte, err error) {
	text = []byte(strconv.Itoa(int(t.UTC().Unix())))
	return
}