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 <charon@lethean.io>
This commit is contained in:
parent
f71d551cdd
commit
dd9f5cfcaf
1 changed files with 1 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue