mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
apps/gophers: simplify type switch
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -198,8 +198,7 @@ func (a *App) run() error {
|
|||||||
a.w.Redraw()
|
a.w.Redraw()
|
||||||
case e := <-a.w.Events():
|
case e := <-a.w.Events():
|
||||||
switch e := e.(type) {
|
switch e := e.(type) {
|
||||||
case input.Event:
|
case key.ChordEvent:
|
||||||
if e, ok := e.(key.ChordEvent); ok {
|
|
||||||
switch e.Name {
|
switch e.Name {
|
||||||
case key.NameEscape:
|
case key.NameEscape:
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
@@ -209,7 +208,6 @@ func (a *App) run() error {
|
|||||||
a.w.Redraw()
|
a.w.Redraw()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
case app.StageEvent:
|
case app.StageEvent:
|
||||||
if e.Stage >= app.StageRunning {
|
if e.Stage >= app.StageRunning {
|
||||||
if a.ctxCancel == nil {
|
if a.ctxCancel == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user