ax(mining): replace banned errors.New with ErrUnsupportedMiner in xmrig.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

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 <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 16:41:15 +01:00
parent f71d551cdd
commit dd9f5cfcaf
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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 {