diff --git a/nil_renderer.go b/nil_renderer.go index a022636..f5637aa 100644 --- a/nil_renderer.go +++ b/nil_renderer.go @@ -5,7 +5,7 @@ type nilRenderer struct{} func (n nilRenderer) start() {} func (n nilRenderer) stop() {} func (n nilRenderer) kill() {} -func (n nilRenderer) write(v string) {} +func (n nilRenderer) write(_ string) {} func (n nilRenderer) repaint() {} func (n nilRenderer) clearScreen() {} func (n nilRenderer) altScreen() bool { return false } diff --git a/tea.go b/tea.go index 9132fff..76c9b3b 100644 --- a/tea.go +++ b/tea.go @@ -314,6 +314,7 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) { if cmd == nil { continue } + msg := cmd() if batchMsg, ok := msg.(BatchMsg); ok { g, _ := errgroup.WithContext(p.ctx) @@ -324,12 +325,13 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) { return nil }) } + //nolint:errcheck g.Wait() // wait for all commands from batch msg to finish continue - } else { - p.Send(msg) } + + p.Send(msg) } }() }