Skip to content

feat(sidekick/swift): a lookup helper#5061

Merged
coryan merged 3 commits intogoogleapis:mainfrom
coryan:feat-lookup-helper
Apr 4, 2026
Merged

feat(sidekick/swift): a lookup helper#5061
coryan merged 3 commits intogoogleapis:mainfrom
coryan:feat-lookup-helper

Conversation

@coryan
Copy link
Copy Markdown
Contributor

@coryan coryan commented Apr 3, 2026

In Rust, too many times I wrote, fmt.Error("could not find thing"). I think we can just have a lookup function that returns the error.

Towards #5037 and #5060

In Rust, too many times I wrote, `fmt.Error("could not find thing")`.
I think we can just have a lookup function that returns the error.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a lookupMessage helper function within the Swift generator package, accompanied by unit tests. The review feedback suggests moving this utility to the shared api package to promote reusability across other language generators. Additionally, it is recommended to refactor the error handling to follow the 'Indent Error Flow' principle and to simplify test failure messages by using t.Fatal(err) directly.

Comment thread internal/sidekick/swift/lookup.go
Comment thread internal/sidekick/swift/lookup.go Outdated
Comment thread internal/sidekick/swift/lookup_test.go Outdated
@coryan
Copy link
Copy Markdown
Contributor Author

coryan commented Apr 3, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new helper function, lookupMessage, to retrieve messages by ID from the API model, along with corresponding unit tests. The review correctly identified that the new function lacks a required doc comment, and a suggestion has been provided to address this documentation standard.

Comment thread internal/sidekick/swift/lookup.go
@coryan coryan marked this pull request as ready for review April 3, 2026 22:23
@coryan coryan requested review from a team as code owners April 3, 2026 22:23
@coryan coryan merged commit 41f6772 into googleapis:main Apr 4, 2026
18 of 19 checks passed
@coryan coryan deleted the feat-lookup-helper branch April 4, 2026 13:11
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