Skip to content

Commit daf75d6

Browse files
committed
feat(iaas): List NICs for Project
Fixed tests and linter relates to STACKITCLI-307 and #1214
1 parent b49d7a1 commit daf75d6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APICli
165165

166166
func outputResult(p *print.Printer, outputFormat string, nics []iaas.NIC, networkLabel string) error {
167167
return p.OutputResult(outputFormat, nics, func() error {
168-
if nics == nil || len(nics) == 0 {
168+
if len(nics) == 0 {
169169
if networkLabel == "" {
170170
p.Outputf("No network interfaces found for your current project\n")
171171
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func TestOutputResult(t *testing.T) {
196196
p.Cmd = NewCmd(&types.CmdParams{Printer: p})
197197
for _, tt := range tests {
198198
t.Run(tt.name, func(t *testing.T) {
199-
if err := outputResult(p, tt.args.outputFormat, tt.args.nics); (err != nil) != tt.wantErr {
199+
if err := outputResult(p, tt.args.outputFormat, tt.args.nics, "Label"); (err != nil) != tt.wantErr {
200200
t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr)
201201
}
202202
})

0 commit comments

Comments
 (0)