summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/repl/completer.go5
-rw-r--r--internal/repl/handlers.go8
-rw-r--r--internal/rpn/variables.go8
3 files changed, 21 insertions, 0 deletions
diff --git a/internal/repl/completer.go b/internal/repl/completer.go
index acdd79a..70a0b86 100644
--- a/internal/repl/completer.go
+++ b/internal/repl/completer.go
@@ -5,6 +5,8 @@ package repl
import (
"strings"
+
+ "github.com/chzyer/readline"
)
// completer provides auto-completion for built-in commands.
@@ -29,6 +31,9 @@ func completer(text string) []string {
return suggestions
}
+// Ensure AutoCompleteAdapter implements readline.AutoCompleter at compile time.
+var _ readline.AutoCompleter = (*AutoCompleteAdapter)(nil)
+
// AutoCompleteAdapter implements the readline AutoCompleter interface,
// providing tab-completion suggestions for built-in commands.
type AutoCompleteAdapter struct {
diff --git a/internal/repl/handlers.go b/internal/repl/handlers.go
index a04a76c..cc9336d 100644
--- a/internal/repl/handlers.go
+++ b/internal/repl/handlers.go
@@ -40,6 +40,14 @@ type CommandHandler interface {
SetNext(next CommandHandler)
}
+// Ensure all handler types implement CommandHandler at compile time.
+var (
+ _ CommandHandler = (*BuiltInCommandHandler)(nil)
+ _ CommandHandler = (*RPNHandler)(nil)
+ _ CommandHandler = (*PercentageHandler)(nil)
+ _ CommandHandler = (*ErrorHandler)(nil)
+)
+
// BaseHandler provides common functionality for all handlers in the chain.
// It stores a reference to the next handler and provides the Next() method
// for forwarding requests.
diff --git a/internal/rpn/variables.go b/internal/rpn/variables.go
index 0ebb52f..eab6546 100644
--- a/internal/rpn/variables.go
+++ b/internal/rpn/variables.go
@@ -65,6 +65,14 @@ type VariableStore interface {
VariablePersistence
}
+// Ensure Variables implements all variable interfaces at compile time.
+var (
+ _ VariableReader = (*Variables)(nil)
+ _ VariableWriter = (*Variables)(nil)
+ _ VariablePersistence = (*Variables)(nil)
+ _ VariableStore = (*Variables)(nil)
+)
+
// NewVariables creates and initializes a new Variables instance.
func NewVariables() *Variables {
return &Variables{