ax(mining): replace banned fmt import with ErrUnsupportedMiner in miner_factory
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

fmt is a banned import (AX §banned-imports). miner_factory.go used
fmt.Errorf for the unsupported-miner error path; the package already
provides ErrUnsupportedMiner() in errors.go, so use that instead and
drop the fmt import entirely.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 07:47:18 +01:00
parent 05a267e051
commit ba198731c2
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -1,7 +1,6 @@
package mining
import (
"fmt"
"strings"
"sync"
)
@ -77,7 +76,7 @@ func (f *MinerFactory) Create(minerType string) (Miner, error) {
constructor, ok := f.constructors[name]
if !ok {
return nil, fmt.Errorf("unsupported miner type: %s", minerType)
return nil, ErrUnsupportedMiner(minerType)
}
return constructor(), nil