ax(mining): replace prose comments with usage examples in miner_factory.go
Some checks failed
Security Scan / security (push) Successful in 29s
Test / test (push) Has been cancelled

AX Principle 2 — comments must show usage, not restate the signature.
MinerConstructor, MinerFactory, and NewMinerFactory had prose descriptions
that added no information beyond what the type already states.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 10:11:37 +01:00
parent 3ba5080234
commit 6b22f2b60d
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -5,10 +5,11 @@ import (
"sync"
)
// MinerConstructor is a function that creates a new miner instance
// f.Register("custom", func() Miner { return NewCustomMiner() })
type MinerConstructor func() Miner
// MinerFactory handles miner instantiation and registration
// factory := NewMinerFactory()
// factory.Register("xmrig", func() Miner { return NewXMRigMiner() })
type MinerFactory struct {
mu sync.RWMutex
constructors map[string]MinerConstructor
@ -18,7 +19,8 @@ type MinerFactory struct {
// globalFactory is the default factory instance
var globalFactory = NewMinerFactory()
// NewMinerFactory creates a new MinerFactory with default miners registered
// factory := NewMinerFactory()
// factory.Register("xmrig", func() Miner { return NewXMRigMiner() })
func NewMinerFactory() *MinerFactory {
f := &MinerFactory{
constructors: make(map[string]MinerConstructor),