MCPcopy Create free account
hub / github.com/francoispqt/gojay / AddObject

Method AddObject

encode_stream.go:141–149  ·  view source on GitHub ↗

AddObject adds an object to be encoded. value must implement MarshalerJSONObject.

(v MarshalerJSONObject)

Source from the content-addressed store, hash-verified

139// AddObject adds an object to be encoded.
140// value must implement MarshalerJSONObject.
141func (s *StreamEncoder) AddObject(v MarshalerJSONObject) {
142 if v.IsNil() {
143 return
144 }
145 s.Encoder.writeByte('{')
146 v.MarshalJSONObject(s.Encoder)
147 s.Encoder.writeByte('}')
148 s.Encoder.writeByte(s.delimiter)
149}
150
151// AddString adds a string to be encoded.
152func (s *StreamEncoder) AddString(v string) {

Callers

nothing calls this directly

Calls 3

writeByteMethod · 0.80
IsNilMethod · 0.65
MarshalJSONObjectMethod · 0.65

Tested by

no test coverage detected