MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / encodeStdlib

Function encodeStdlib

libs/json/encoder.go:240–249  ·  view source on GitHub ↗
(w io.Writer, v interface{})

Source from the content-addressed store, hash-verified

238}
239
240func encodeStdlib(w io.Writer, v interface{}) error {
241 // Doesn't stream the output because that adds a newline, as per:
242 // https://golang.org/pkg/encoding/json/#Encoder.Encode
243 blob, err := json.Marshal(v)
244 if err != nil {
245 return err
246 }
247 _, err = w.Write(blob)
248 return err
249}
250
251func writeStr(w io.Writer, s string) error {
252 _, err := w.Write([]byte(s))

Callers 4

encodeReflectFunction · 0.85
encodeReflectListFunction · 0.85
encodeReflectMapFunction · 0.85
encodeReflectStructFunction · 0.85

Calls 2

WriteMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected