TransformContainer calls transform, passing it the body of the most recently opened container and replacing the original body with the return value. It panics if the receiver has no open container.
(transform func(Bytes) Bytes)
| 113 | // opened container and replacing the original body with the return value. It |
| 114 | // panics if the receiver has no open container. |
| 115 | func (b *Builder) TransformContainer(transform func(Bytes) Bytes) { |
| 116 | bodyOff := b.containers[len(b.containers)-1] |
| 117 | body := transform(b.bytes[bodyOff:]) |
| 118 | b.bytes = append(b.bytes[:bodyOff], body...) |
| 119 | } |
| 120 | |
| 121 | // Append appends val. |
| 122 | func (b *Builder) Append(val []byte) { |
no outgoing calls