Comment
Comment by saclark11
You can do this in Go by making a type declaration defining a function and then adding a method with the same signature on that type, which calls the function. The Go standard library does exactly this with the `HandlerFunc` type [1].
[1]: https://cs.opensource.google/go/go/+/refs/tags/go1.25.4:src/...