diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-20 15:46:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-20 15:46:14 +0200 |
commit | e89f87624f27b7b98efc959bd96e260ac86f9236 (patch) | |
tree | 6561a1c1eb1660736c48d668f43ccaf67cce19a2 /vendor/gopkg.in/yaml.v2/writerc.go | |
parent | 1dd5118eebe0e993d55ae5433cb2dcfd2764bf4f (diff) | |
download | git-bug-e89f87624f27b7b98efc959bd96e260ac86f9236.tar.gz |
generate markdown documentation
Diffstat (limited to 'vendor/gopkg.in/yaml.v2/writerc.go')
-rw-r--r-- | vendor/gopkg.in/yaml.v2/writerc.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/gopkg.in/yaml.v2/writerc.go b/vendor/gopkg.in/yaml.v2/writerc.go new file mode 100644 index 00000000..a2dde608 --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/writerc.go @@ -0,0 +1,26 @@ +package yaml + +// Set the writer error and return false. +func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { + emitter.error = yaml_WRITER_ERROR + emitter.problem = problem + return false +} + +// Flush the output buffer. +func yaml_emitter_flush(emitter *yaml_emitter_t) bool { + if emitter.write_handler == nil { + panic("write handler not set") + } + + // Check if the buffer is empty. + if emitter.buffer_pos == 0 { + return true + } + + if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { + return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) + } + emitter.buffer_pos = 0 + return true +} |