ax(batch): remove banned fmt import from xmrig_test.go
Replaces fmt.Sscanf with strconv.Atoi for port parsing, removing the banned fmt import from the test file per AX banned-imports rules. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
14cf520778
commit
a7b7d6a2aa
1 changed files with 2 additions and 2 deletions
|
|
@ -3,13 +3,13 @@ package mining
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
|
@ -196,7 +196,7 @@ func TestXMRigMiner_GetStats_Good(t *testing.T) {
|
|||
miner.API.ListenHost, miner.API.ListenPort = server.Listener.Addr().String(), 0
|
||||
parts := strings.Split(server.Listener.Addr().String(), ":")
|
||||
miner.API.ListenHost = parts[0]
|
||||
fmt.Sscanf(parts[1], "%d", &miner.API.ListenPort)
|
||||
miner.API.ListenPort, _ = strconv.Atoi(parts[1])
|
||||
|
||||
stats, err := miner.GetStats(context.Background())
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue