Skip to content

Commit 4581187

Browse files
committed
enhance: sizes comparing never can be less than zeros
Signed-off-by: nabil salah <nabil.salah203@gmail.com>
1 parent 8d2702d commit 4581187

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/gateway/gateway.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func (g *gatewayModule) SetNamedProxy(wlID string, config zos.GatewayNameProxy)
558558
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
559559
defer cancel()
560560

561-
if len(config.Backends) <= 0 {
561+
if len(config.Backends) == 0 {
562562
return "", fmt.Errorf("at least one backend is needed got '%d'", len(config.Backends))
563563
}
564564
twinID, _, _, err := gridtypes.WorkloadID(wlID).Parts()
@@ -599,7 +599,7 @@ func (g *gatewayModule) SetFQDNProxy(wlID string, config zos.GatewayFQDNProxy) e
599599
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
600600
defer cancel()
601601

602-
if len(config.Backends) <= 0 {
602+
if len(config.Backends) == 0 {
603603
return fmt.Errorf("at least one backend is needed got '%d'", len(config.Backends))
604604
}
605605
cfg, err := g.ensureGateway(ctx, false)

pkg/gateway_light/gateway.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ func (g *gatewayModule) SetNamedProxy(wlID string, config zos.GatewayNameProxy)
569569
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
570570
defer cancel()
571571

572-
if len(config.Backends) <= 0 {
572+
if len(config.Backends) == 0 {
573573
return "", fmt.Errorf("at least one backend is needed got '%d'", len(config.Backends))
574574
}
575575
twinID, _, _, err := gridtypes.WorkloadID(wlID).Parts()
@@ -610,7 +610,7 @@ func (g *gatewayModule) SetFQDNProxy(wlID string, config zos.GatewayFQDNProxy) e
610610
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
611611
defer cancel()
612612

613-
if len(config.Backends) <= 0 {
613+
if len(config.Backends) == 0 {
614614
return fmt.Errorf("at least one backend is needed got '%d'", len(config.Backends))
615615
}
616616
domain, err := g.ensureGateway(ctx, false)

0 commit comments

Comments
 (0)