From 5b4006ac86c436d30388ae9862c1a5e9e0f87828 Mon Sep 17 00:00:00 2001 From: Guangming Wang Date: Sat, 2 May 2020 14:25:44 +0800 Subject: [PATCH] cleanup: remove unnacessary nil check before range (#7194) Signed-off-by: Guangming Wang --- discovery/azure/azure.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/discovery/azure/azure.go b/discovery/azure/azure.go index 4666bfca5..2b8635dc2 100644 --- a/discovery/azure/azure.go +++ b/discovery/azure/azure.go @@ -302,11 +302,9 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) { labels[azureLabelMachineScaleSet] = model.LabelValue(vm.ScaleSet) } - if vm.Tags != nil { - for k, v := range vm.Tags { - name := strutil.SanitizeLabelName(k) - labels[azureLabelMachineTag+model.LabelName(name)] = model.LabelValue(*v) - } + for k, v := range vm.Tags { + name := strutil.SanitizeLabelName(k) + labels[azureLabelMachineTag+model.LabelName(name)] = model.LabelValue(*v) } // Get the IP address information via separate call to the network provider.