From 8247d62ab3b27c478fe8435730bbb1ec052ffd31 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 13:06:48 +0100 Subject: [PATCH] ax(mining): replace prose comment with usage example on isValidAlgo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AX Principle 2: comments must show HOW with real values, not restate what the type signature already says. "checks if an algorithm name contains only valid characters" is a prose description — replaced with concrete call examples. Co-Authored-By: Charon --- pkg/mining/mining.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/mining/mining.go b/pkg/mining/mining.go index d82eba5..2934da0 100644 --- a/pkg/mining/mining.go +++ b/pkg/mining/mining.go @@ -221,7 +221,8 @@ func containsShellChars(s string) bool { return false } -// isValidAlgo checks if an algorithm name contains only valid characters +// isValidAlgo("rx/0") == true +// isValidAlgo("rx/0;rm -rf /") == false func isValidAlgo(algo string) bool { for _, r := range algo { if !((r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '-' || r == '/' || r == '_') {