chore(inputs): Remove unnecessary nil check (#13749)

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2023-08-14 16:39:56 +08:00 committed by GitHub
parent 2f1edfbbfc
commit 7e6b98226e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -410,10 +410,8 @@ func (p *Prometheus) gatherURL(u URLAndAddress, acc telegraf.Accumulator) error
req.SetBasicAuth(p.Username, p.Password)
}
if p.HTTPHeaders != nil {
for key, value := range p.HTTPHeaders {
req.Header.Set(key, value)
}
for key, value := range p.HTTPHeaders {
req.Header.Set(key, value)
}
var resp *http.Response

View File

@ -1388,11 +1388,9 @@ func (e *Endpoint) populateTags(objectRef *objectRef, resourceType string, resou
}
// Fill in custom values if they exist
if objectRef.customValues != nil {
for k, v := range objectRef.customValues {
if v != "" {
t[k] = v
}
for k, v := range objectRef.customValues {
if v != "" {
t[k] = v
}
}
}