From 41688ddaef5cbc6aa7a048508db48295776e3d68 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 1 Mar 2024 14:22:22 -0500 Subject: [PATCH] chore: don't shadow 'handler' type (#779) --- tea.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tea.go b/tea.go index b6a92b0ca1..3267fddca0 100644 --- a/tea.go +++ b/tea.go @@ -101,18 +101,19 @@ const ( withoutBracketedPaste ) -// handlers manages series of channels returned by various processes. It allows -// us to wait for those processes to terminate before exiting the program. -type handlers []chan struct{} +// channelHandlers manages the series of channels returned by various processes. +// It allows us to wait for those processes to terminate before exiting the +// program. +type channelHandlers []chan struct{} // Adds a channel to the list of handlers. We wait for all handlers to terminate // gracefully on shutdown. -func (h *handlers) add(ch chan struct{}) { +func (h *channelHandlers) add(ch chan struct{}) { *h = append(*h, ch) } // shutdown waits for all handlers to terminate. -func (h handlers) shutdown() { +func (h channelHandlers) shutdown() { var wg sync.WaitGroup for _, ch := range h { wg.Add(1) @@ -427,7 +428,7 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) { // terminated by either [Program.Quit], [Program.Kill], or its signal handler. // Returns the final model. func (p *Program) Run() (Model, error) { - handlers := handlers{} + handlers := channelHandlers{} cmds := make(chan Cmd) p.errs = make(chan error) p.finished = make(chan struct{}, 1)