Skip to content

Commit 0ce6cdd

Browse files
committed
fix: review feedback
1 parent 59094c5 commit 0ce6cdd

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

internal/cmd/beta/network-interface/list/list.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
8282
if err != nil {
8383
p.Debug(print.ErrorLevel, "get network name: %v", err)
8484
networkLabel = *model.NetworkId
85-
}
86-
if networkLabel == "" {
85+
} else if networkLabel == "" {
8786
networkLabel = *model.NetworkId
8887
}
8988
p.Info("No network interfaces found for network %q\n", networkLabel)

internal/cmd/beta/network-interface/update/update.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APICli
219219
}
220220

221221
func outputResult(p *print.Printer, outputFormat, projectId string, nic *iaas.NIC) error {
222+
if nic == nil {
223+
return fmt.Errorf("nic is empty")
224+
}
222225
switch outputFormat {
223226
case print.JSONOutputFormat:
224227
details, err := json.MarshalIndent(nic, "", " ")

internal/cmd/beta/network-interface/update/update_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func Test_outputResult(t *testing.T) {
306306
{
307307
name: "empty",
308308
args: args{},
309-
wantErr: false,
309+
wantErr: true,
310310
},
311311
{
312312
name: "set empty nic",

0 commit comments

Comments
 (0)