Skip to content

Add support for Go build tags when loading CRD packages - #203

Open
siyer-corp wants to merge 1 commit into
elastic:masterfrom
siyer-corp:feat/build-tags
Open

Add support for Go build tags when loading CRD packages#203
siyer-corp wants to merge 1 commit into
elastic:masterfrom
siyer-corp:feat/build-tags

Conversation

@siyer-corp

@siyer-corp siyer-corp commented Sep 6, 2026

Copy link
Copy Markdown

Summary:

Add support for Go build tags when loading CRD packages

Some API packages are gated behind Go build tags such as //go:build enterprise. This adds a repeatable --build-tags flag so documentation generation can include those types when needed.

This also fixes a subtle bug in the package loader behavior: the Go tool only respects the last -tags flag it sees, while the loader prepends -tags=ignore_autogenerated. To keep autogenerated files excluded without dropping user-specified tags, we merge ignore_autogenerated into the final -tags value before loading packages.

Includes:

  • CLI support for repeated --build-tags
  • README usage example
  • unit coverage for tag flag construction

@cla-checker-service

cla-checker-service Bot commented Sep 6, 2026

Copy link
Copy Markdown

💚 CLA has been signed

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.

1 participant