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)
| 570 | // be used if the values are known to be valid json, e.g. because they were originally created |
| 571 | // by json.Unmarshal. |
| 572 | func (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. |
no outgoing calls