From d3ce9f55473492d67f074bd28926052ed2f27811 Mon Sep 17 00:00:00 2001 From: Ada Fernsby Date: Fri, 6 Mar 2026 10:44:05 +0000 Subject: [PATCH] ledger: add a strict variant of Apply Generated with format-patch -C so the shared history is visible in review. --- internal/ledger/{apply.go => apply_strict.go} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) copy internal/ledger/{apply.go => apply_strict.go} (85%) diff --git a/internal/ledger/apply.go b/internal/ledger/apply_strict.go similarity index 85% copy from internal/ledger/apply.go copy to internal/ledger/apply_strict.go index 95f499d..3211ad6 100644 --- a/internal/ledger/apply.go +++ b/internal/ledger/apply_strict.go @@ -5,8 +5,8 @@ // ErrShortBalance is returned when a posting would drive the balance negative. var ErrShortBalance = errors.New("ledger: insufficient balance") -// Apply posts one delta against the running balance and returns the new total. -func Apply(balance, delta int64) (int64, error) { +// ApplyStrict posts one delta against the running balance and returns the new total. +func ApplyStrict(balance, delta int64) (int64, error) { if balance+delta < 0 { return balance, ErrShortBalance } -- 2.43.0