ax(batch): remove banned fmt import from xmrig_test.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

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:
Claude 2026-04-02 18:21:13 +01:00
parent 14cf520778
commit a7b7d6a2aa
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

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