From efb4760d85794b24d8c1dd1727ae374d499f240f Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Tue, 25 Jun 2024 16:17:15 -0400 Subject: don't panic if there are not enough operands --- ui.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ui.go') diff --git a/ui.go b/ui.go index bd39eaf..4d121a7 100644 --- a/ui.go +++ b/ui.go @@ -54,9 +54,7 @@ func (ui UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) { ui.calc.negate() case "+", "-", "*", "/", "%", "^": operator := msg.String()[0] - if err := ui.calc.performOperation(operator); err != nil { - panic(err) - } + ui.calc.performOperation(operator) case "backspace": if len(ui.calc.buf) > 0 { ui.calc.buf = ui.calc.buf[:len(ui.calc.buf)-1] -- cgit v1.2.3