Merge Go template declarations directly by tamird · Pull Request #16092 · google/gvisor · GitHub
Skip to content

Merge Go template declarations directly - #16092

Open
tamird wants to merge 1 commit into
google:masterfrom
tamird:fix/go-merge-declarations
Open

tamird wants to merge 1 commit into
google:masterfrom
tamird:fix/go-merge-declarations

Conversation

@tamird

@tamird tamird commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Go template merging used ast.MergePackageFiles, which is deprecated and
filters functions by name. This could discard valid init functions and
methods on distinct generic receivers.

Collect declarations from filename-sorted sources directly. Retain import
normalization and declaration-local comment printing so generated
templates preserve annotations and token positions. Leave duplicate
definitions to the compiler instead of choosing a body by documentation.

Assisted-by: Codex

Go template merging used ast.MergePackageFiles, which is deprecated and
filters functions by name. This could discard valid init functions and
methods on distinct generic receivers.

Collect declarations from filename-sorted sources directly. Retain import
normalization and declaration-local comment printing so generated
templates preserve annotations and token positions. Leave duplicate
definitions to the compiler instead of choosing a body by documentation.

Assisted-by: Codex
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