From 5e52d5ce222d9dd65c343b5b99c6b1b15ce54fe1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 23 May 2026 23:46:47 +0300 Subject: fix(rpn): correct misleading comment in parseCategory The comment incorrectly stated the function iterates 'using range' (Go's range keyword), but it actually uses a for loop bounded by _sentinel. Also removed the misleading OCP compliance claim since adding new Category constants also requires updating the String() switch statement. --- internal/rpn/operations_metric_cmd.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/rpn/operations_metric_cmd.go b/internal/rpn/operations_metric_cmd.go index 868c92a..1915507 100644 --- a/internal/rpn/operations_metric_cmd.go +++ b/internal/rpn/operations_metric_cmd.go @@ -81,9 +81,9 @@ func (o *Operations) MetricCompatible(stack *Stack) (string, error) { } // parseCategory converts a category name string to a Category constant. -// Iterates over all valid Category values using range, so adding a new -// Category constant (between Universal and _sentinel) automatically makes -// it available here without modifying this function (OCP compliance). +// Iterates over all valid Category values using a for loop bounded by _sentinel, +// so adding a new Category constant (between Universal and _sentinel) automatically +// makes it available here without modifying this function. func parseCategory(name string) (Category, bool) { for cat := Category(0); cat <= _sentinel; cat++ { if cat.String() == name { -- cgit v1.2.3