From 327932c36f1dcf732557176b3948fa4290ca972a Mon Sep 17 00:00:00 2001 From: Taimoor Ahmad Date: Mon, 25 Sep 2023 17:19:10 -0400 Subject: [PATCH] insert David's syntax suggestion --- src/cmd/tag.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cmd/tag.go b/src/cmd/tag.go index cb1d9259..35bc4a00 100644 --- a/src/cmd/tag.go +++ b/src/cmd/tag.go @@ -135,17 +135,13 @@ opslevel get tag --type=Service ID|ALIAS KEY | jq tags, err := GetTags(result) cobra.CheckErr(err) - var output []opslevel.Tag + output := []opslevel.Tag{} for _, tag := range tags.Nodes { if tagKey == tag.Key { output = append(output, tag) } } - // return empty JSON array instead of null - if len(output) == 0 { - output = make([]opslevel.Tag, 0) - } common.PrettyPrint(output) }, }