NewWriteContext creates a new write context
(trackRef bool, maxDepth int)
| 51 | |
| 52 | // NewWriteContext creates a new write context |
| 53 | func NewWriteContext(trackRef bool, maxDepth int) *WriteContext { |
| 54 | return &WriteContext{ |
| 55 | buffer: NewByteBuffer(nil), |
| 56 | refWriter: NewRefWriter(trackRef), |
| 57 | trackRef: trackRef, |
| 58 | maxDepth: maxDepth, |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // Reset clears state for reuse (called before each Serialize) |
| 63 | func (c *WriteContext) Reset() { |
no test coverage detected