refactor(server/utils): remove redundant nil check

From the Go specification:

  "3. If the map is nil, the number of iterations is 0." [1]

Therefore, an additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2023-09-09 12:57:20 +08:00
parent 1d6f569f92
commit f3b672a4cf
No known key found for this signature in database
GPG Key ID: DAEBBD2E34C111E6

View File

@ -83,10 +83,8 @@ func RegisterEvent(ctx context.Context, eventName string, authRecipe string, use
}
req.Header.Set("Content-Type", "application/json")
if webhook.Headers != nil {
for key, val := range webhook.Headers {
req.Header.Set(key, val.(string))
}
for key, val := range webhook.Headers {
req.Header.Set(key, val.(string))
}
client := &http.Client{Timeout: time.Second * 30}