ax(mining): replace prose comment with usage example on instanceNameRegex
AX Principle 2: comments show HOW with real values, not WHAT the name already says. The old comment restated the variable name; the new comment shows a concrete ReplaceAllString call with input and expected output. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
5610491832
commit
7d7dfce6ea
1 changed files with 1 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ import (
|
|||
"forge.lthn.ai/Snider/Mining/pkg/logging"
|
||||
)
|
||||
|
||||
// sanitizeInstanceName ensures the instance name only contains safe characters.
|
||||
// safe := instanceNameRegex.ReplaceAllString("my algo!", "_") // => "my_algo_"
|
||||
var instanceNameRegex = regexp.MustCompile(`[^a-zA-Z0-9_/-]`)
|
||||
|
||||
// ManagerInterface defines the contract for a miner manager.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue