PLTCONN-4069: Refactoring

This commit is contained in:
Megan Tran
2023-11-07 14:56:25 -06:00
parent 78fad111cd
commit 38a71b3924
2 changed files with 5 additions and 8 deletions

View File

@@ -34,9 +34,9 @@ var accountReadChecks = []Check{
rand.Shuffle(len(accounts), func(i, j int) {
accounts[i], accounts[j] = accounts[j], accounts[i]
})
count := int64(0)
for _, account := range accounts {
if count == readLimit {
for index, account := range accounts {
if int64(index) == readLimit {
break
}
acct, _, err := cc.AccountRead(ctx, account.ID(), account.UniqueID(), nil)
@@ -44,7 +44,6 @@ var accountReadChecks = []Check{
res.err(err)
return
}
count++
if acct.Identity != account.Identity {
res.errf("want %q; got %q", account.Identity, acct.Identity)
}

View File

@@ -49,9 +49,8 @@ var entitlementReadChecks = []Check{
entitlements[i], entitlements[j] = entitlements[j], entitlements[i]
})
count := int64(0)
for _, e := range entitlements {
if count == readLimit {
for index, e := range entitlements {
if int64(index) == readLimit {
break
}
eRead, _, err := cc.EntitlementRead(ctx, e.ID(), e.UniqueID(), "group", nil)
@@ -59,7 +58,6 @@ var entitlementReadChecks = []Check{
res.errf("failed to read entitlement %q: %s", e.Identity, err.Error())
return
}
count++
if e.Identity != eRead.Identity {
res.errf("want %q; got %q", e.Identity, eRead.Identity)
}