diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-25 21:58:36 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-25 21:58:36 +0200 |
| commit | 9ee6293b175710e7cf1ff5bc9a6dc555ddaf559f (patch) | |
| tree | 34da64728c21c195147969eda153774db6455d62 /internal/perc | |
| parent | 25b2728a6499b427e201fb80d8a70e65909645e0 (diff) | |
code-quality: Various improvements to code quality and thread safety
Diffstat (limited to 'internal/perc')
| -rw-r--r-- | internal/perc/perc.go | 8 |
1 files changed, 4 insertions, 4 deletions
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) } |
