Introduction
Ok, this will be a short one.
In the previous posts; we tried to reduce endpoint handler boilerplate in Go by imitating the Axum magic functions. This post is not about that, but I think one of the tricks we pulled there may have another use case.
If you’ll recall, we iterated through two separate solutions to the endpoint problem, where in the latter one
we used struct fields to represent endpoint parameters.
To initialize those fields into any references that internally retain type info, we used reflect.NewAt
with the field offset like this:

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.