package main import ( "citrons.xyz/talk/tui" "time" ) func main() { tui.Start() app := newApplication("localhost:27508") go app.RunClient() drawTick := time.Tick(time.Second / 60) redraw := true for { select { case m := <-app.Messages(): m.Handle(app) redraw = true case e := <-tui.Events(): app.onInput(e) redraw = true case <-drawTick: if redraw { app.show() redraw = false } } } }