Generated Go

Contract

The generated file is ordinary Go source in the same package as the .gx file. It uses github.com/busdk/bus-gx/pkg/gx and the v0.1.1 shared interfaces to construct validated nodes.

Generated Go contains:

  • the original top-level Go declarations with GX markup expressions lowered to ordinary gx.Node expressions
  • source-location metadata needed for diagnostics
  • deterministic code formatting suitable for gofmt

The generated file must be testable with go test ./... without a browser, controller, fixture runtime, or provider service.

Artifact Boundary

The .gx file remains the human-authored template source. The generated .go file is a build artifact that can be regenerated from source and compared in golden tests.