Skip to content

internal: move WriteFormatted to internal/codegen - #2133

Open
kolyshkin wants to merge 1 commit into
cilium:mainfrom
kolyshkin:codegen-writeformatted
Open

kolyshkin wants to merge 1 commit into
cilium:mainfrom
kolyshkin:codegen-writeformatted

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

WriteFormatted is only used by code generators (bpf2go and gentypes), but since it lives in package internal, every binary importing cilium/ebpf links go/format and a handful of its dependencies (go/parser, go/printer, go/scanner etc.), and runs their package initialization on every start.

Move it to a new separate internal/codegen package to avoid excessive dependencies.

AIL:4

WriteFormatted is only used by code generators (bpf2go and gentypes),
but since it lives in package internal, every binary importing
cilium/ebpf links go/format and its dependencies (go/parser, go/printer,
go/scanner, go/token etc.), and runs their package initialization on
every start.

Move it to a new internal/codegen package, so that the library itself
no longer depends on go/*.

AIL:4
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
kolyshkin requested a review from a team as a code owner October 19, 2026 06:59
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