Skip to content

Commit 9f314bd

Browse files
committed
remove unnecessary slice
1 parent 3273588 commit 9f314bd

File tree

1 file changed

+1
-4
lines changed
  • internal/cmd/public-ip/ranges/list

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
"strings"
87

98
"github.com/goccy/go-yaml"
109
"github.com/spf13/cobra"
@@ -140,13 +139,11 @@ func outputResult(p *print.Printer, outputFormat string, publicIpRanges []iaas.P
140139

141140
return nil
142141
default:
143-
var cidrs []string
144142
for _, item := range publicIpRanges {
145143
if item.Cidr != nil && *item.Cidr != "" {
146-
cidrs = append(cidrs, *item.Cidr)
144+
p.Outputln(*item.Cidr)
147145
}
148146
}
149-
p.Outputln(strings.Join(cidrs, "\n"))
150147

151148
return nil
152149
}

0 commit comments

Comments
 (0)