[#54] *: Fix linter warnings
All checks were successful
DCO action / DCO (pull_request) Successful in 2m25s
Tests and linters / Tests (1.20) (pull_request) Successful in 3m19s
Tests and linters / Tests with -race (pull_request) Successful in 4m42s
Tests and linters / Tests (1.19) (pull_request) Successful in 5m29s
Tests and linters / Lint (pull_request) Successful in 5m53s
All checks were successful
DCO action / DCO (pull_request) Successful in 2m25s
Tests and linters / Tests (1.20) (pull_request) Successful in 3m19s
Tests and linters / Tests with -race (pull_request) Successful in 4m42s
Tests and linters / Tests (1.19) (pull_request) Successful in 5m29s
Tests and linters / Lint (pull_request) Successful in 5m53s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
0671f42ee1
commit
d989c8d2a3
3 changed files with 19 additions and 22 deletions
|
@ -1,8 +1,10 @@
|
|||
package sessiontest
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/internal/random"
|
||||
refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
|
||||
statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test"
|
||||
|
@ -167,7 +169,7 @@ func GenerateSessionTokenBody(empty bool) *session.TokenBody {
|
|||
m.SetOwnerID(refstest.GenerateOwnerID(false))
|
||||
m.SetLifetime(GenerateTokenLifetime(false))
|
||||
|
||||
switch random.Uint32(2) {
|
||||
switch randomInt(2) {
|
||||
case 0:
|
||||
m.SetContext(GenerateObjectSessionContext(false))
|
||||
case 1:
|
||||
|
@ -236,3 +238,7 @@ func GenerateXHeaders(empty bool) []session.XHeader {
|
|||
|
||||
return xs
|
||||
}
|
||||
|
||||
func randomInt(n int) int {
|
||||
return rand.New(rand.NewSource(time.Now().UnixNano())).Intn(n)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue