ax(mining): replace banned fmt import with ErrUnsupportedMiner in miner_factory
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:
parent
05a267e051
commit
ba198731c2
1 changed files with 1 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue