The nil check before the range loop is redundant

Signed-off-by: Rijnard van Tonder <hi.teresy@gmail.com>
This commit is contained in:
Rijnard van Tonder 2018-10-10 16:05:48 -04:00
parent a2a78d0a09
commit 9d102e3bff
1 changed files with 3 additions and 5 deletions

View File

@ -244,11 +244,9 @@ func (d *Discovery) refresh() (tg *targetgroup.Group, err error) {
} }
// GCE labels are key-value pairs that group associated resources // GCE labels are key-value pairs that group associated resources
if inst.Labels != nil { for key, value := range inst.Labels {
for key, value := range inst.Labels { name := strutil.SanitizeLabelName(key)
name := strutil.SanitizeLabelName(key) labels[gceLabelLabel+model.LabelName(name)] = model.LabelValue(value)
labels[gceLabelLabel+model.LabelName(name)] = model.LabelValue(value)
}
} }
if len(priIface.AccessConfigs) > 0 { if len(priIface.AccessConfigs) > 0 {