Skip to content

feat(go): add NoSnippets to disable snippetgen#5027

Merged
noahdietz merged 4 commits intogoogleapis:mainfrom
noahdietz:go-omit-snippets
Apr 3, 2026
Merged

feat(go): add NoSnippets to disable snippetgen#5027
noahdietz merged 4 commits intogoogleapis:mainfrom
noahdietz:go-omit-snippets

Conversation

@noahdietz
Copy link
Copy Markdown
Contributor

The Go gapic generator has a flag - omit-snippets - that disables snippet generation. Add a GoAPI property NoSnippets that triggers the inclusion of this flag and disable librarian Go functionality related to moving snippets around (because they won't have been generated).

This will be especially important for Previews bc we don't want Go snippets for preview clients, and NoSnippets = true will be a default applied to all Preview entries for Go.

Fixes #5025

@noahdietz noahdietz requested a review from a team as a code owner April 2, 2026 21:37
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 NoSnippets configuration option to the GoAPI struct, allowing users to skip snippet generation. The implementation includes updating the GAPIC options to include omit-snippets, bypassing snippet movement and updates when the flag is set, and ensuring the isEmptyAPI check accounts for this new field. Corresponding test cases have been added to verify the behavior in TestBuildGAPICOpts, TestMoveGeneratedFiles, and TestIsEmptyAPI. I have no feedback to provide.

@noahdietz noahdietz requested a review from JoeWang1127 April 2, 2026 21:47
@noahdietz noahdietz enabled auto-merge (squash) April 2, 2026 21:59
@noahdietz noahdietz merged commit 92c633c into googleapis:main Apr 3, 2026
18 checks passed
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.

previews(go): add ability to disable snippet generation via generator omit-snippets flag

2 participants