commit b2d2c5f18f387e01695805ab0aeb9b0809e44fd0
parent 4f66e99561e6f294c2e7b7779a0d0582d4c4a5a5
Author: lash <dev@holbrook.no>
Date: Fri, 20 Sep 2024 15:43:08 +0100
Add doc to loop
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/engine/loop.go b/engine/loop.go
@@ -17,6 +17,9 @@ import (
// Any error not handled by the engine will terminate the oop and return an error.
//
// Rendered output is written to the provided writer.
+//
+// If initial is set, the value will be used for the first (initializing) execution
+// If nil, an empty byte value will be used.
func Loop(ctx context.Context, en Engine, reader io.Reader, writer io.Writer, initial []byte) error {
defer en.Finish()
if initial == nil {