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

impl(generator): configurable packages for Rust codec #166

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Nov 12, 2024

Part of the work for #158

@coryan coryan marked this pull request as ready for review November 12, 2024 19:43
@coryan coryan requested a review from codyoss November 12, 2024 20:11
@@ -369,6 +431,25 @@ func (*Codec) FormatDocComments(documentation string) []string {
return ss
}

func (c *Codec) RequiredPackages() []string {
lines := []string{}
Copy link
Member

Choose a reason for hiding this comment

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

nit: you don't need to allocate slices in Go because of the append idiom

Suggested change
lines := []string{}
var lines []string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am going to merge as-is to unblock other work. Could you take a few minutes to answer a basic golang question?

In this case there may be no append() call. Is it safe to return a nil lines if that is the case? I will send a follow up PR if that is true.

@coryan coryan merged commit 7e37818 into googleapis:main Nov 13, 2024
10 checks passed
@coryan coryan deleted the impl-generator-rust-configurable-packages branch November 13, 2024 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants