{"version":"1.0","type":"rich","title":"See the blog post: https://derekchiang.com/posts/reusable-and-type-safe-options-for-go-apis","description":"This example demonstrates a type-safe functional options pattern for Go APIs, using the `Get` and `Delete` functions to apply reusable option structs like `WithPrefix` and `WithRev`. The `GetOption` and `DeleteOption` interfaces enforce compile-time compatibility, allowing `WithPrefix` to work across both operations while rejecting mismatched options like passing `WithRev` to `Delete`. The code prints the assembled option structs via `fmt.Printf` in `main`, showing how each option mutates its respective configuration.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-a1434aa3829ac2164103766379ad992e?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}