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

Function write_break

emitterc.go:117–136  ·  view source on GitHub ↗

Copy a line break character from a string into buffer.

(emitter *yaml_emitter_t, s []byte, i *int)

Source from the content-addressed store, hash-verified

115
116// Copy a line break character from a string into buffer.
117func write_break(emitter *yaml_emitter_t, s []byte, i *int) bool {
118 if s[*i] == '\n' {
119 if !put_break(emitter) {
120 return false
121 }
122 *i++
123 } else {
124 if !write(emitter, s, i) {
125 return false
126 }
127 if emitter.column == 0 {
128 emitter.space_above = true
129 }
130 emitter.column = 0
131 emitter.line++
132 // [Go] Do this here and above and drop from everywhere else (see commented lines).
133 emitter.indention = true
134 }
135 return true
136}
137
138// Set an emitter error and return false.
139func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool {

Calls 2

put_breakFunction · 0.85
writeFunction · 0.85

Tested by

no test coverage detected