Skip to content

Commit 35fe8c9

Browse files
committed
fix: consistent else if-clause for labels
1 parent f4c54a9 commit 35fe8c9

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

internal/cmd/beta/public-ip/associate/associate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
5959
if err != nil {
6060
p.Debug(print.ErrorLevel, "get public IP: %v", err)
6161
publicIpLabel = model.PublicIpId
62-
}
63-
if publicIpLabel == "" {
62+
} else if publicIpLabel == "" {
6463
publicIpLabel = model.PublicIpId
6564
}
6665

internal/cmd/beta/public-ip/create/create.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
6767
if err != nil {
6868
p.Debug(print.ErrorLevel, "get project name: %v", err)
6969
projectLabel = model.ProjectId
70-
}
71-
if projectLabel == "" {
70+
} else if projectLabel == "" {
7271
projectLabel = model.ProjectId
7372
}
7473

internal/cmd/beta/public-ip/delete/delete.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
5757
if err != nil {
5858
p.Debug(print.ErrorLevel, "get public IP: %v", err)
5959
publicIpLabel = model.PublicIpId
60-
}
61-
if publicIpLabel == "" {
60+
} else if publicIpLabel == "" {
6261
publicIpLabel = model.PublicIpId
6362
}
6463

internal/cmd/beta/public-ip/disassociate/disassociate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
5555
if err != nil {
5656
p.Debug(print.ErrorLevel, "get public IP: %v", err)
5757
publicIpLabel = model.PublicIpId
58-
}
59-
if publicIpLabel == "" {
58+
} else if publicIpLabel == "" {
6059
publicIpLabel = model.PublicIpId
6160
}
6261

internal/cmd/beta/public-ip/list/list.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
8181
if err != nil {
8282
p.Debug(print.ErrorLevel, "get project name: %v", err)
8383
projectLabel = model.ProjectId
84-
}
85-
if projectLabel == "" {
84+
} else if projectLabel == "" {
8685
projectLabel = model.ProjectId
8786
}
8887
p.Info("No public IPs found for project %q\n", projectLabel)

0 commit comments

Comments
 (0)