// Marshal the VoteSet to JSON. Same as String(), just in JSON,
// and without the height/round/type_ (since its already included in the votes).
962190
func (voteSet *VoteSet) MarshalJSON() ([]byte, error) {
	voteSet.mtx.Lock()
	defer voteSet.mtx.Unlock()
	return cdc.MarshalJSON(VoteSetJSON{
		voteSet.voteStrings(),
		voteSet.bitArrayString(),
		voteSet.peerMaj23s,
	})
}
257745
func (s *Serializer) Marshal(v interface{}) ([]byte, error) {
	pb, ok := v.(proto.Message)
	if !ok {
		return nil, constants.ErrWrongValueType
	}
	return proto.Marshal(pb)
}
914377
func (resp *QueryResponse) MarshalJSON() ([]byte, error) {
	if resp.Err != nil {
		return json.Marshal(struct {
			Err string `json:"error"`
		}{Err: resp.Err.Error()})
	}

	return json.Marshal(struct {
		Results        []interface{}    `json:"results"`
		ColumnAttrSets []*ColumnAttrSet `json:"columnAttrs,omitempty"`
	}{
		Results:        resp.Results,
		ColumnAttrSets: resp.ColumnAttrSets,
	})
}
979845
func (b *PeopleJSONBuilder) Marshal(orig *People) ([]byte, error) {
	ret, err := b.Convert(orig)
	if err != nil {
		return nil, err
	}
	return json.Marshal(ret)
}
1221199
func (e attErr) Marshal() []byte {
	// little-endian encoding for attr
	return []byte{attOpError, e.opcode, byte(e.attr), byte(e.attr >> 8), byte(e.status)}
}
664212
func (t *Type) MarshalJSON() ([]byte, error) {
	var aux string

	switch *t {
	case RoundRobin:
		aux = roundRobinName
	}

	b, err := json.Marshal(aux)
	if err != nil {
		return nil, err
	}

	return b, nil
}
115194
func (sa *StringArray) MarshalJSON() ([]byte, error) {
	if sa == nil || !sa.Valid {
		return []byte("null"), nil
	}

	return json.Marshal(sa.StringArray)
}
216607
func (o OvsSet) MarshalJSON() ([]byte, error) {
	var oSet []interface{}
	oSet = append(oSet, "set")
	oSet = append(oSet, o.GoSet)
	return json.Marshal(oSet)
}
1332892
func (s *set) MarshalJSON() ([]byte, error) {
	if s.keys == nil {
		return json.Marshal([]interface{}{})
	}
	return json.Marshal(s.keys)
}
201062
func (l *Line) MarshalJSON() ([]byte, error) {
	return json.Marshal([2]Point{l.a, l.b})
}
268375
func (t PrimitiveType) MarshalJSON() ([]byte, error) {
	switch t {
	case NullType, IntegerType, StringType, ObjectType, ArrayType, BooleanType, NumberType:
		return json.Marshal(t.String())
	default:
		return nil, errors.New("unknown primitive type")
	}
}
358511
func (a *MessageImagemapAction) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type ImagemapActionType `json:"type"`
		Text string             `json:"text"`
		Area ImagemapArea       `json:"area"`
	}{
		Type: ImagemapActionTypeMessage,
		Text: a.Text,
		Area: a.Area,
	})
}
8011
func (t *Collection) MarshalJSON() ([]byte, error) {
	rnl := t.rootAddRef()
	defer t.rootDecRef(rnl)
	return rnl.MarshalJSON()
}
1093980
func (sj *SerializerJSON) Marshal(message proto.Message) ([]byte, error) {
	if message == nil {
		return []byte("null"), nil
	}
	var buf bytes.Buffer
	if err := DefaultMarshaler.Marshal(&buf, message); err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
507681
func (m *VoteSetBitsMessage) String() string {
	return fmt.Sprintf("[VSB %v/%02d/%v %v %v]", m.Height, m.Round, m.Type, m.BlockID, m.Votes)
}
1103541
func (notOperation *Not) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Not  Comparison
		Next string
	}{
		Not:  notOperation.Comparison,
		Next: notOperation.Next.Name(),
	})
}
1236020
func Marshal(g geom.T) (string, error) {
	b := &bytes.Buffer{}
	if err := write(b, g); err != nil {
		return "", err
	}
	return b.String(), nil
}