1
0
mirror of https://github.com/TwiN/gatus.git synced 2026-03-24 06:30:06 +00:00

refactor: Simplify and modernize loops (#1522)

* refactor: Simplify loops

* refactor: Modernize loops using range over int

---------

Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
PythonGermany
2026-02-09 01:08:59 +01:00
committed by GitHub
parent e5b4e0d381
commit f09d959c97
17 changed files with 45 additions and 78 deletions

View File

@@ -53,11 +53,11 @@ func BenchmarkStore_GetAllEndpointStatuses(b *testing.B) {
numberOfEndpoints := []int{10, 25, 50, 100}
for _, numberOfEndpointsToCreate := range numberOfEndpoints {
// Create endpoints and insert results
for i := 0; i < numberOfEndpointsToCreate; i++ {
for i := range numberOfEndpointsToCreate {
ep := testEndpoint
ep.Name = "endpoint" + strconv.Itoa(i)
// InsertEndpointResult 20 results for each endpoint
for j := 0; j < 20; j++ {
for range 20 {
scenario.Store.InsertEndpointResult(&ep, &testSuccessfulResult)
}
}
@@ -191,7 +191,7 @@ func BenchmarkStore_GetEndpointStatusByKey(b *testing.B) {
},
}
for _, scenario := range scenarios {
for i := 0; i < 50; i++ {
for range 50 {
scenario.Store.InsertEndpointResult(&testEndpoint, &testSuccessfulResult)
scenario.Store.InsertEndpointResult(&testEndpoint, &testUnsuccessfulResult)
}