diff options
Diffstat (limited to 'engine')
| -rw-r--r-- | engine/engine.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engine/engine.go b/engine/engine.go index 7a5399c..15ee568 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -104,13 +104,16 @@ func (e *Engine) Format(events []LineEvent) []string { func (e *Engine) FormatToString(events []LineEvent) string { lines := e.Format(events) - output := strings.Join(lines, "\n") + lines = append(lines, "") - if !strings.HasSuffix(output, "\n") { - output += "\n" - } + return strings.Join(lines, "\n") +} + +func (e *Engine) FormatToBytes(events []LineEvent) []byte { + lines := e.Format(events) + lines = append(lines, "") - return output + return []byte(strings.Join(lines, "\n")) } func (e *Engine) findNextNonComment(events []LineEvent, startIndex int) int { |