Why don't you use context.WithValue(r.Context(), <key>, <value>) for passing the injected values you want to your HTTP handlers. Then defer the logic for retrieving whatever you want for that handler to a middleware function.
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/732f914e-e99d-4473-bafa-cf624e65af6d%40www.fastmail.com.