flunk flushes whatever chunk data we've got buffered into a single instruction
()
| 277 | |
| 278 | // flunk flushes whatever chunk data we've got buffered into a single instruction |
| 279 | func (e *StructEncoder) flunk() { |
| 280 | |
| 281 | b := e.cb.Bytes |
| 282 | bs := b[e.cpos:] |
| 283 | e.cpos = len(b) |
| 284 | |
| 285 | if len(bs) == 0 { |
| 286 | return |
| 287 | } |
| 288 | |
| 289 | e.instructions = append(e.instructions, instruction{static: bs, kind: kindStatic}) |
| 290 | } |
| 291 | |
| 292 | // valueInst works out the conversion function we need for `k` and creates an instruction to write it to the buffer |
| 293 | func (e *StructEncoder) valueInst(k reflect.Kind, instr func(func(unsafe.Pointer, *Buffer))) { |
no outgoing calls
no test coverage detected