MCPcopy
hub / github.com/go-yaml/yaml / yaml_emitter_flush

Function yaml_emitter_flush

writerc.go:33–48  ·  view source on GitHub ↗

Flush the output buffer.

(emitter *yaml_emitter_t)

Source from the content-addressed store, hash-verified

31
32// Flush the output buffer.
33func yaml_emitter_flush(emitter *yaml_emitter_t) bool {
34 if emitter.write_handler == nil {
35 panic("write handler not set")
36 }
37
38 // Check if the buffer is empty.
39 if emitter.buffer_pos == 0 {
40 return true
41 }
42
43 if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil {
44 return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error())
45 }
46 emitter.buffer_pos = 0
47 return true
48}

Callers 6

flushFunction · 0.85
putFunction · 0.85
put_breakFunction · 0.85
writeFunction · 0.85

Calls 2

ErrorMethod · 0.80

Tested by

no test coverage detected