From 9ee6293b175710e7cf1ff5bc9a6dc555ddaf559f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 25 Mar 2026 21:58:36 +0200 Subject: code-quality: Various improvements to code quality and thread safety --- internal/perc/perc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/perc') diff --git a/internal/perc/perc.go b/internal/perc/perc.go index 9921ce4..63a171e 100644 --- a/internal/perc/perc.go +++ b/internal/perc/perc.go @@ -120,13 +120,13 @@ func ParseCalculation(input string) (*Calculation, error) { registry.register(parseXIsWhatPercentOfY) registry.register(parseXIsYPercentOfWhat) - calc, ok, err := registry.parse(input) - if ok { - return calc, nil - } + calc, _, err := registry.parse(input) if err != nil { return nil, err } + if calc != nil { + return calc, nil + } return nil, fmt.Errorf("perc: unable to parse input %q. See usage for examples", input) } -- cgit v1.2.3