From dfe3255abbabf5c557ca691a50278028aaa321e3 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 16:11:30 +0100 Subject: [PATCH] ax(mining): replace banned errors.New with ErrUnsupportedMiner in ttminer Remove the banned `errors` import from ttminer.go. The single call to errors.New is replaced with the existing ErrUnsupportedMiner constructor from errors.go, which carries the OS name, HTTP status, and a details note about CUDA requirements. Co-Authored-By: Charon --- pkg/mining/ttminer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/mining/ttminer.go b/pkg/mining/ttminer.go index ad272fa..4897b10 100644 --- a/pkg/mining/ttminer.go +++ b/pkg/mining/ttminer.go @@ -2,7 +2,6 @@ package mining import ( "bytes" - "errors" "fmt" "os" "os/exec" @@ -109,7 +108,7 @@ func (m *TTMiner) Install() error { // Linux version - uses .tar.gz url = fmt.Sprintf("https://github.com/TrailingStop/TT-Miner-release/releases/download/%s/TT-Miner-%s.tar.gz", version, version) default: - return errors.New("TT-Miner is only available for Windows and Linux (requires CUDA)") + return ErrUnsupportedMiner(runtime.GOOS).WithDetails("TT-Miner requires CUDA; only Windows and Linux are supported") } if err := m.InstallFromURL(url); err != nil {