Skip to content

Commit

Permalink
Update generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Mar 21, 2020
1 parent 8129b77 commit b4814ae
Show file tree
Hide file tree
Showing 2 changed files with 519 additions and 75 deletions.
8 changes: 7 additions & 1 deletion aws/internal/keyvaluetags/generators/servicetags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ func {{ . | Title }}KeyValueTags(tags []*{{ . | TagPackage }}.{{ . | TagType }})
m := make(map[string]*string, len(tags))
for _, tag := range tags {
m[aws.StringValue(tag.{{ . | TagTypeKeyField }})] = tag.{{ . | TagTypeValueField }}
if tag.{{ . | TagTypeValueField }} == nil {
// {{ . | TagTypeKeyField }}-only tag
m[aws.StringValue(tag.{{ . | TagTypeKeyField }})] = aws.String("")
} else {
// {{ . | TagTypeKeyField }}-{{ . | TagTypeValueField }} tag
m[aws.StringValue(tag.{{ . | TagTypeKeyField }})] = tag.{{ . | TagTypeValueField }}
}
}
return New(m)
Expand Down
Loading

0 comments on commit b4814ae

Please sign in to comment.