diff options
author | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-08-09 15:59:15 +0200 |
---|---|---|
committer | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-08-09 16:39:21 +0200 |
commit | 863486a6b71ed0e562a3965bed56465d007b1418 (patch) | |
tree | e93f6a687695af86d54237ec9f575d4ef104222d /vendor/github.com/zclconf/go-cty-yaml/writerc.go | |
parent | 49c1c7b4dc69ffb9ab52330e6dc52ccdd6351087 (diff) | |
download | terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.gz terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.zst terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.zip |
update vendor and go.modadd_contact_groups
Diffstat (limited to 'vendor/github.com/zclconf/go-cty-yaml/writerc.go')
-rw-r--r-- | vendor/github.com/zclconf/go-cty-yaml/writerc.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/zclconf/go-cty-yaml/writerc.go b/vendor/github.com/zclconf/go-cty-yaml/writerc.go new file mode 100644 index 0000000..a2dde60 --- /dev/null +++ b/vendor/github.com/zclconf/go-cty-yaml/writerc.go | |||
@@ -0,0 +1,26 @@ | |||
1 | package yaml | ||
2 | |||
3 | // Set the writer error and return false. | ||
4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { | ||
5 | emitter.error = yaml_WRITER_ERROR | ||
6 | emitter.problem = problem | ||
7 | return false | ||
8 | } | ||
9 | |||
10 | // Flush the output buffer. | ||
11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { | ||
12 | if emitter.write_handler == nil { | ||
13 | panic("write handler not set") | ||
14 | } | ||
15 | |||
16 | // Check if the buffer is empty. | ||
17 | if emitter.buffer_pos == 0 { | ||
18 | return true | ||
19 | } | ||
20 | |||
21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { | ||
22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) | ||
23 | } | ||
24 | emitter.buffer_pos = 0 | ||
25 | return true | ||
26 | } | ||