mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
chore: fix some errors detected by staticcheck (#3089)
* chore: fix some errors detected by staticcheck * feat: remove `rand.Seed()` usage for possibly using "fastrand64" runtime to avoid locking ref: https://pkg.go.dev/math/rand#Seed
This commit is contained in:
parent
173b03448f
commit
a994bf8b04
10 changed files with 23 additions and 27 deletions
|
@ -3,7 +3,7 @@ package scenarios
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
|
@ -80,7 +80,7 @@ func TestMetrics(t *testing.T) {
|
|||
if resp.StatusCode != http.StatusOK {
|
||||
t.Error("unexpected pprof status code")
|
||||
}
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ func TestMetrics(t *testing.T) {
|
|||
if resp2.StatusCode != http.StatusOK {
|
||||
t.Error("unexpected expvars status code")
|
||||
}
|
||||
body2, err2 := ioutil.ReadAll(resp2.Body)
|
||||
body2, err2 := io.ReadAll(resp2.Body)
|
||||
if err2 != nil {
|
||||
t.Fatal(err2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue