From 978d35d356e8752bdd272884df48a6289d88b40a Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Sun, 31 Jul 2022 14:32:48 +0200 Subject: lint: homogenize operations and minor fixes (gocritic) Apply GoDoc comment policy (comments for humans should have a space after the //; machine-readable comments shouldn't) Use strings.ReplaceAll instead of strings.Replace when appropriate Remove if/else chains by replacing them with switches Use short assignment/increment notation Replace single case switches with if statements Combine else and if when appropriate Signed-off-by: Moritz Poldrack Acked-by: Robin Jarry --- lib/ui/ui.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/ui/ui.go') diff --git a/lib/ui/ui.go b/lib/ui/ui.go index 1f618a6f..596000a5 100644 --- a/lib/ui/ui.go +++ b/lib/ui/ui.go @@ -87,8 +87,7 @@ func (state *UI) Tick() bool { select { case event := <-state.tcEvents: - switch event := event.(type) { - case *tcell.EventResize: + if event, ok := event.(*tcell.EventResize); ok { state.screen.Clear() width, height := event.Size() state.ctx = NewContext(width, height, state.screen, state.onPopover) -- cgit