chore(update): handles nil values properly now, it worked first try perfectly for everything but just having the desc param

This commit is contained in:
DarthMooMancer committed 2026-11-13 13:39:01 -05:00
1 parent 72a95c96f3
commit 988da3a978
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -25,13 +25,13 @@
}, },
{ {
"id": 5, "id": 5,
"string": "Food ", "string": "Not Food ",
"amount": 40, "amount": 40,
"date": "2026-11-13T13:17:02.100182-05:00" "date": "2026-11-13T13:17:02.100182-05:00"
}, },
{ {
"id": 6, "id": 6,
"string": "Groceries", "string": "Not Groceries ",
"amount": 100, "amount": 100,
"date": "2026-11-13T13:35:58.552665-05:00" "date": "2026-11-13T13:35:58.552665-05:00"
} }
+1 -1
View File
@@ -105,7 +105,7 @@ func update(fileName string, idx int, desc string, amount float64) error {
expense.Desc = desc expense.Desc = desc
} }
if amount != -1 { if amount != 0 {
expense.Amount = amount expense.Amount = amount
} }
exp[c] = expense exp[c] = expense