Go
Glue supports go as a code generation target, allowing you to generate Go structs and enums from Glue models.
Simply run:
shell
#Configuration
You can configure the emitted package name:
yaml
#Example
For this Glue spec:
glue
...generating Go...
shell
...will produce code similar to:
go
#Notes
- Optional fields are emitted as pointers and include
,omitemptyin JSON tags. int/uintand fixed-width integer primitives emit their Go equivalents (int,uint,int8,uint64, etc.).- Unions are emitted as
interface{}. Record<K, V>is emitted asmap[K]V.- Tuples with arity 2 through 4 are emitted as generated
TupleN[...]helper types that marshal as JSON arrays; larger tuples fall back to fixed[N]interface{}arrays. - Glue
typealiases are emitted as exported Go aliases when their generated names are exported. Aliases starting with_are inlined instead. - Anonymous structs are emitted as generated structs named from the owning field path.