Generating type-safe Go code from hand-written SQL: https://github.com/kyleconroy/sqlc
Really interesting approach, but I wonder if generated code is the right approach? It's certainly IDE friendly.
Related Posts
Really cute approach to reporting type errors: when there's a type error, show an example of a runtime error that the type check has prevented!
Data-Driven Techniques for Type Error Diagnosis https://escholarship.org/uc/item/59s4h4pv
Go has an elegant approach to defining example functions, which are shown in docs as `main()` with the output: https://go.dev/blog/examples
Over a sufficiently long time horizon, all code you write is legacy code.