From 3afbfbf8c2e7819a828279b3f584515c0ef15d5f Mon Sep 17 00:00:00 2001 From: A-440Hz Date: Fri, 17 Dec 2021 19:11:28 -0800 Subject: [PATCH] fix(cli): Remove duplication of target host sources (#1805) fix(cli): Remove duplication of target host sources --- internal/cmd/commands/targetscmd/funcs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cmd/commands/targetscmd/funcs.go b/internal/cmd/commands/targetscmd/funcs.go index cc238d7c5..beab8249a 100644 --- a/internal/cmd/commands/targetscmd/funcs.go +++ b/internal/cmd/commands/targetscmd/funcs.go @@ -676,7 +676,8 @@ func printItemTable(result api.GenericResult) string { maxLength := base.MaxAttributesLength(nonAttributeMap, item.Attributes, keySubstMap) var hostSourceMaps []map[string]interface{} - if len(item.HostSources) > 0 { + switch { + case len(item.HostSources) > 0: for _, set := range item.HostSources { m := map[string]interface{}{ "ID": set.Id, @@ -687,8 +688,7 @@ func printItemTable(result api.GenericResult) string { if l := len("Host Catalog ID"); l > maxLength { maxLength = l } - } - if len(item.HostSets) > 0 { + case len(item.HostSets) > 0: for _, set := range item.HostSets { m := map[string]interface{}{ "ID": set.Id,