Skip to content

Commit 304c3ca

Browse files
dkorunicmjuraga
authored andcommitted
BUG: Fix ineffective outer loop break
1 parent 2d10e52 commit 304c3ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

discovery/aws_service_discovery_instance.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,15 @@ func (a *awsService) instancePortFromEC2(instance types.Instance) (port int, err
346346

347347
func (a *awsInstance) serviceNameFromEC2(instance types.Instance) (string, error) {
348348
var name, port string
349+
L:
349350
for _, t := range instance.Tags {
350351
switch {
351352
case *t.Key == HAProxyServiceNameTag:
352353
name = aws.ToString(t.Value)
353354
case *t.Key == HAProxyServicePortTag:
354355
port = aws.ToString(t.Value)
355356
case len(name) > 0 && len(port) > 0:
356-
break
357+
break L
357358
}
358359
}
359360

0 commit comments

Comments
 (0)