From 591f12f6c2eafa0d565ed85867d03e92f28406b5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 20 Mar 2026 22:55:39 +0200 Subject: internal/calculator/internal/repl: Add missing comments for exported functions - Added Parse() comment in calculator.go - Updated Commands() comment in repl/commands.go to be more descriptive --- internal/calculator/calculator.go | 2 ++ internal/repl/commands.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/calculator/calculator.go b/internal/calculator/calculator.go index fdca99b..b876a48 100644 --- a/internal/calculator/calculator.go +++ b/internal/calculator/calculator.go @@ -7,6 +7,8 @@ import ( "strings" ) +// Parse parses a percentage calculation input string and returns the result. +// It handles formats like "20% of 150", "30 is what % of 150", and "30 is 20% of what". func Parse(input string) (string, error) { input = strings.ToLower(strings.TrimSpace(input)) input = strings.ReplaceAll(input, "what is ", "") diff --git a/internal/repl/commands.go b/internal/repl/commands.go index 656f670..d03672e 100644 --- a/internal/repl/commands.go +++ b/internal/repl/commands.go @@ -8,7 +8,7 @@ import ( // builtinCommands defines the built-in REPL commands var builtinCommands = []string{"help", "clear", "quit", "exit", "rpn", "calc"} -// Commands returns the list of built-in command names +// Commands returns the list of built-in command names supported by the REPL. func Commands() []string { return builtinCommands } -- cgit v1.2.3