MCPcopy Create free account
hub / github.com/segmentio/encoding / SetTrustRawMessage

Method SetTrustRawMessage

json/json.go:572–578  ·  view source on GitHub ↗

SetTrustRawMessage skips value checking when encoding a raw json message. It should only be used if the values are known to be valid json, e.g. because they were originally created by json.Unmarshal.

(on bool)

Source from the content-addressed store, hash-verified

570// be used if the values are known to be valid json, e.g. because they were originally created
571// by json.Unmarshal.
572func (enc *Encoder) SetTrustRawMessage(on bool) {
573 if on {
574 enc.flags |= TrustRawMessage
575 } else {
576 enc.flags &= ^TrustRawMessage
577 }
578}
579
580// SetAppendNewline is an extension to the standard encoding/json package which
581// allows the program to toggle the addition of a newline in Encode on or off.

Callers 1

TestSetTrustRawMessageFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestSetTrustRawMessageFunction · 0.76