1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

chore(code): use int ranges in loops BE-10990 (#12028)

This commit is contained in:
andres-portainer 2024-07-10 19:22:47 -03:00 committed by GitHub
parent 468c12c75b
commit 31bdb948a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 183 additions and 169 deletions

View file

@ -157,28 +157,33 @@ func Test_customTemplateGitFetch(t *testing.T) {
t.Run("can return the expected file content by multiple calls from one user", func(t *testing.T) {
var wg sync.WaitGroup
wg.Add(5)
for i := 0; i < 5; i++ {
for range 5 {
go func() {
singleAPIRequest(h, jwt1, is, "abcdefg")
wg.Done()
}()
}
wg.Wait()
})
t.Run("can return the expected file content by multiple calls from different users", func(t *testing.T) {
var wg sync.WaitGroup
wg.Add(10)
for i := 0; i < 10; i++ {
for i := range 10 {
go func(j int) {
if j%2 == 0 {
singleAPIRequest(h, jwt1, is, "abcdefg")
} else {
singleAPIRequest(h, jwt2, is, "abcdefg")
}
wg.Done()
}(i)
}
wg.Wait()
})