aboutsummaryrefslogtreecommitdiffstats
path: root/ui.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-06-25 16:17:15 -0400
committerSam Anthony <sam@samanthony.xyz>2024-06-25 16:17:15 -0400
commitefb4760d85794b24d8c1dd1727ae374d499f240f (patch)
tree7f9b5dd931a97388cdc192f6bd5f849c88dce99d /ui.go
parentee56cc539398a7fc1664f39cf16428fa13c262c9 (diff)
downloadpfc-efb4760d85794b24d8c1dd1727ae374d499f240f.zip
don't panic if there are not enough operands
Diffstat (limited to 'ui.go')
-rw-r--r--ui.go4
1 files changed, 1 insertions, 3 deletions
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]