working commit

This commit is contained in:
2026-02-21 13:16:30 +02:00
parent cd37a4508c
commit d650d58a6d
1149 changed files with 116 additions and 722633 deletions
-31
View File
@@ -1,31 +0,0 @@
// Copyright 2006-2010 Kirill Simonov
// Copyright 2011-2019 Canonical Ltd
// Copyright 2025 The go-yaml Project Contributors
// SPDX-License-Identifier: Apache-2.0 AND MIT
// Output writer with buffering.
// Provides write buffering for the emitter stage.
package libyaml
import "fmt"
// Flush the output buffer.
func (emitter *Emitter) flush() error {
if emitter.write_handler == nil {
panic("write handler not set")
}
// Check if the buffer is empty.
if emitter.buffer_pos == 0 {
return nil
}
if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil {
return WriterError{
Err: fmt.Errorf("write error: %w", err),
}
}
emitter.buffer_pos = 0
return nil
}