awslabs / goformation

GoFormation is a Go library for working with CloudFormation templates.
Apache License 2.0
841 stars 197 forks source link

feat(template): support optional parameters #548

Closed rubenfonseca closed 1 year ago

rubenfonseca commented 1 year ago

Issue #, if available: #542

Description of changes:

Marks optional fields as pointers so we can serialize/deserialize with confidence.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

rubenfonseca commented 1 year ago

@rclark can you please check to see if this makes sense to you?

codecov-commenter commented 1 year ago

Codecov Report

Base: 6.13% // Head: 6.13% // No change to project coverage :thumbsup:

Coverage data is based on head (5179716) compared to base (5ab72b1). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #548 +/- ## ====================================== Coverage 6.13% 6.13% ====================================== Files 30 30 Lines 16519 16519 ====================================== Hits 1014 1014 Misses 15480 15480 Partials 25 25 ``` | [Impacted Files](https://codecov.io/gh/awslabs/goformation/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs) | Coverage Δ | | |---|---|---| | [cloudformation/template.go](https://codecov.io/gh/awslabs/goformation/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-Y2xvdWRmb3JtYXRpb24vdGVtcGxhdGUuZ28=) | `2.89% <ø> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

rclark commented 1 year ago

:+1: Yep that solves my problem. Thank you!

xrn commented 1 year ago

There is no need to make a pointer on [] in golang as far as i know AllowedValues *[]interface{}

rubenfonseca commented 1 year ago

@xrn you're absolutely right. Can you please check if it makes sense now?

xrn commented 1 year ago

Looks great

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 7.7.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: