Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(go): variadic type helpers to build slices #2755

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Mar 29, 2021

It is somewhat inconvenient to build slices of optional values, and
new variadic helpers can help soothe that pain in many circumstances...

Adding variadic slice helpers:

  • Bools
  • Numbers
  • Strings
  • Times

Effectively, this allows replacing:

&[]*string{
  jsii.String("Foo"),
  jsii.String("Bar"),
  jsii.String("Baz"),
}

With the more compact:

jsii.Strings("Foo", "Bar", "Baz")

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

It is somewhat inconvenient to build slices of optional values, and
new variadic helpers can help soothe that pain in many circumstances...

Adding variadic slice helpers:
- `Bools`
- `Numbers`
- `Strings`
- `Times`
@RomainMuller RomainMuller requested a review from a team March 29, 2021 13:55
@RomainMuller RomainMuller self-assigned this Mar 29, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 29, 2021
Copy link
Contributor

@MrArnoldPalmer MrArnoldPalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@mergify
Copy link
Contributor

mergify bot commented Mar 29, 2021

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Mar 29, 2021
@mergify mergify bot merged commit baf83aa into main Mar 29, 2021
@mergify mergify bot deleted the rmuller/add-plural-helpers branch March 29, 2021 15:28
@mergify
Copy link
Contributor

mergify bot commented Mar 29, 2021

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Mar 29, 2021
RomainMuller added a commit that referenced this pull request Mar 29, 2021
It is somewhat inconvenient to build slices of optional values, and
new variadic helpers can help soothe that pain in many circumstances...

Adding variadic slice helpers:
- `Bools`
- `Numbers`
- `Strings`
- `Times`

Effectively, this allows replacing:

```go
&[]*string{
  jsii.String("Foo"),
  jsii.String("Bar"),
  jsii.String("Baz"),
}
```

With the more compact:

```go
jsii.Strings("Foo", "Bar", "Baz")
```

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants