Goop 1.3.0
Goop 1.3.0
Goop 1.3.0 adds native Go interface implementations, allowing Goop record
types to satisfy interfaces such as fmt.Stringer and slog.Handler without
writing an @[go] wrapper for their methods.
Highlights
implementsdeclarations:implements Interface for Type with … end
generates pointer-receiver Go methods and a compile-time interface
assertion.- Go type imports: use
type Nameinside animport gosignature block
to import opaque Go named types and interfaces. - FFI value types:
error,'a ptr(ptr_of,null,is_null), and
'a go_sliceplus length, append, and list-conversion helpers. - Examples: native
fmt.Stringerand
slog.Handler
implementations.
Verification
goop check docs/examples/go_implements_stringer.goopgoop check docs/examples/go_implements_slog_handler.goopgoop test tests/- Verify generated Go accepts the emitted
fmt.Stringerandslog.Handler
assertions during the example builds.