diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-13 13:01:48 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-13 13:01:48 +0200 |
commit | 548090e67f66acf84385c4152ca464e52d3e3319 (patch) | |
tree | 9b6de528bd7b0aa63362fa83f5c8e6a97f68a5d8 /vendor/github.com/a-h/templ/flush.go | |
parent | a1d809960bee74df19c7e5fc34ffd1e4757cfdcb (diff) |
Migrate away from templ and towards html/template
Diffstat (limited to 'vendor/github.com/a-h/templ/flush.go')
-rw-r--r-- | vendor/github.com/a-h/templ/flush.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/github.com/a-h/templ/flush.go b/vendor/github.com/a-h/templ/flush.go deleted file mode 100644 index 56d7d3a..0000000 --- a/vendor/github.com/a-h/templ/flush.go +++ /dev/null @@ -1,36 +0,0 @@ -package templ - -import ( - "context" - "io" -) - -// Flush flushes the output buffer after all its child components have been rendered. -func Flush() FlushComponent { - return FlushComponent{} -} - -type FlushComponent struct { -} - -type flusherError interface { - Flush() error -} - -type flusher interface { - Flush() -} - -func (f FlushComponent) Render(ctx context.Context, w io.Writer) (err error) { - if err = GetChildren(ctx).Render(ctx, w); err != nil { - return err - } - switch w := w.(type) { - case flusher: - w.Flush() - return nil - case flusherError: - return w.Flush() - } - return nil -} |