From 6eaa71ba0d7c0b56853860c2f1eb43096dd928e7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Mar 2026 22:30:42 +0200 Subject: Replace global variable with function in internal/repl --- internal/repl/commands.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/repl/commands.go') diff --git a/internal/repl/commands.go b/internal/repl/commands.go index d03672e..2f3a942 100644 --- a/internal/repl/commands.go +++ b/internal/repl/commands.go @@ -6,11 +6,13 @@ import ( ) // builtinCommands defines the built-in REPL commands -var builtinCommands = []string{"help", "clear", "quit", "exit", "rpn", "calc"} +func builtinCommands() []string { + return []string{"help", "clear", "quit", "exit", "rpn", "calc"} +} // Commands returns the list of built-in command names supported by the REPL. func Commands() []string { - return builtinCommands + return builtinCommands() } // ExecuteCommand runs a built-in command and returns its output or error -- cgit v1.2.3