From b8eb29a6fac7f7fbc472d03a3bae267c72bda58c Mon Sep 17 00:00:00 2001 From: taimoor ahmad <139589712+taimoor-at-opslevel@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:59:08 -0400 Subject: [PATCH] Update src/cmd/tag.go Co-authored-by: David Bloss --- src/cmd/tag.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/cmd/tag.go b/src/cmd/tag.go index 4df7a4e4..5b02a17c 100644 --- a/src/cmd/tag.go +++ b/src/cmd/tag.go @@ -32,23 +32,17 @@ opslevel create tag --type=Team ID|ALIAS KEY VALUE value := args[2] if cmd.Flag("assign").Changed { - var input opslevel.TagAssignInput tagInput := opslevel.TagInput{ Key: key, Value: value, } + input := opslevel.TagAssignInput{Tags: []opslevel.TagInput{tagInput}} if opslevel.IsID(resource) { - input = opslevel.TagAssignInput{ - Id: opslevel.ID(resource), - Tags: []opslevel.TagInput{tagInput}, - } + input.Id = opslevel.ID(resource) } else { - input = opslevel.TagAssignInput{ - Alias: resource, - Type: opslevel.TaggableResource(resourceType), - Tags: []opslevel.TagInput{tagInput}, - } + input.Alias = resource + input.Type = opslevel.TaggableResource(resourceType) } result, err := getClientGQL().AssignTag(input)