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:
parent
1d6f569f92
commit
f3b672a4cf
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue
Block a user