Go SDK generator V2
We released a “V2” of the Go SDK generator, with a completely redesigned JSON model, more ergonomic union types, and a cleaner DX across the board.
- No need for pkg.F(…) constructors
- petstore.Pet{ Name: petstore.F("Joey") } → petstore.Pet{ Name: "Joey" }
- Pointer-free JSON model using omitzero: Ergonomic optional and nullable parameters using the new standard library omitzero JSON semantics.
- Improved discoverability of union variants: Unions now use a struct-based design with json:",omitzero,inline" semantics instead of interfaces for better discoverability
- Ergonomic access to shared fields in union types: No need to switch on variants when you know the property you want
- Automatic helper generation for complex union variants:
- Supports unmarshalling into parameters: Request parameter types, including unions, can now be unmarshalled from external input.
We’re continuing to expand Go support. Send us a note if there is anything you’d like to see in upcoming updates. support@stainless.com