BeginContainer opens a new container.
()
| 37 | |
| 38 | // BeginContainer opens a new container. |
| 39 | func (b *Builder) BeginContainer() { |
| 40 | // Allocate one byte for the container tag. When EndContainer writes |
| 41 | // the tag, it will arrange for additional space if required. |
| 42 | b.bytes = append(b.bytes, 0) |
| 43 | // Push the offset of the container body onto the stack. |
| 44 | b.containers = append(b.containers, len(b.bytes)) |
| 45 | } |
| 46 | |
| 47 | // EndContainer closes the most recently opened container. It panics if the |
| 48 | // receiver has no open container. |
no outgoing calls