1
0
mirror of https://github.com/TwiN/gatus.git synced 2026-02-12 06:29:01 +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

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"maps"
"net/http"
"strconv"
"strings"
@@ -170,9 +171,7 @@ func (provider *AlertProvider) buildRequestBody(cfg *Config, ep *endpoint.Endpoi
// Merge metadata: cfg.Metadata + ep.ExtraLabels (if present)
mergedMetadata := map[string]interface{}{}
// Copy cfg.Metadata
for k, v := range cfg.Metadata {
mergedMetadata[k] = v
}
maps.Copy(mergedMetadata, cfg.Metadata)
// Add extra labels from endpoint (if present)
if ep.ExtraLabels != nil && len(ep.ExtraLabels) > 0 {
for k, v := range ep.ExtraLabels {