From dd9f5cfcaf5190c395ef8d690a0777d22a632ff8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 16:41:15 +0100 Subject: [PATCH] ax(mining): replace banned errors.New with ErrUnsupportedMiner in xmrig.go The `errors` package is banned; all errors must use the package's own error constructors. Replace `errors.New("unsupported operating system")` with `ErrUnsupportedMiner(runtime.GOOS)` which also surfaces the actual OS name in the error message. Co-Authored-By: Charon --- pkg/mining/xmrig.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/mining/xmrig.go b/pkg/mining/xmrig.go index c33f067..5705b0f 100644 --- a/pkg/mining/xmrig.go +++ b/pkg/mining/xmrig.go @@ -2,7 +2,6 @@ package mining import ( "bytes" - "errors" "fmt" "net/http" "os" @@ -119,7 +118,7 @@ func (m *XMRigMiner) Install() error { case "darwin": url = fmt.Sprintf("https://github.com/xmrig/xmrig/releases/download/%s/xmrig-%s-macos-x64.tar.gz", version, strings.TrimPrefix(version, "v")) default: - return errors.New("unsupported operating system") + return ErrUnsupportedMiner(runtime.GOOS) } if err := m.InstallFromURL(url); err != nil {